From 859bbe94f5135f7814623a1494224fd1d77f218f Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 12 Feb 2016 17:05:37 +0100 Subject: [PATCH] upgrading magit --- elpa/magit-20160117.2129/magit-popup.el | 1264 ----------------- elpa/magit-20160117.2129/magit.info | 163 --- .../AUTHORS.md | 2 +- .../COPYING | 0 .../dir | 0 .../git-rebase.el | 0 .../magit-apply.el | 47 +- .../magit-autoloads.el | 177 ++- .../magit-autorevert.el | 96 +- .../magit-bisect.el | 7 +- .../magit-blame.el | 3 +- .../magit-commit.el | 0 .../magit-core.el | 0 .../magit-diff.el | 6 +- .../magit-ediff.el | 0 .../magit-extras.el | 0 .../magit-git.el | 160 ++- .../magit-log.el | 99 +- .../magit-mode.el | 17 +- .../magit-pkg.el | 8 +- .../magit-process.el | 60 +- .../magit-remote.el | 53 +- .../magit-section.el | 0 .../magit-sequence.el | 0 .../magit-stash.el | 13 +- elpa/magit-20160211.2105/magit-submodule.el | 174 +++ .../magit-utils.el | 10 +- .../magit-wip.el | 15 +- .../magit.el | 139 +- elpa/magit-20160211.2105/magit.info | 163 +++ .../magit.info-1 | 365 +++-- .../magit.info-2 | Bin 22604 -> 22974 bytes .../dir | 0 .../magit-popup-autoloads.el | 2 +- .../magit-popup-pkg.el | 2 +- .../magit-popup.el | 2 +- .../magit-popup.info | 0 37 files changed, 1087 insertions(+), 1960 deletions(-) delete mode 100644 elpa/magit-20160117.2129/magit-popup.el delete mode 100644 elpa/magit-20160117.2129/magit.info rename elpa/{magit-20160117.2129 => magit-20160211.2105}/AUTHORS.md (99%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/COPYING (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/dir (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/git-rebase.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-apply.el (92%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-autoloads.el (94%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-autorevert.el (59%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-bisect.el (97%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-blame.el (99%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-commit.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-core.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-diff.el (99%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-ediff.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-extras.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-git.el (90%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-log.el (95%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-mode.el (98%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-pkg.el (55%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-process.el (95%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-remote.el (93%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-section.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-sequence.el (100%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-stash.el (97%) create mode 100644 elpa/magit-20160211.2105/magit-submodule.el rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-utils.el (97%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit-wip.el (95%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit.el (96%) create mode 100644 elpa/magit-20160211.2105/magit.info rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit.info-1 (97%) rename elpa/{magit-20160117.2129 => magit-20160211.2105}/magit.info-2 (98%) rename elpa/{magit-popup-20160117.1513 => magit-popup-20160130.649}/dir (100%) rename elpa/{magit-popup-20160117.1513 => magit-popup-20160130.649}/magit-popup-autoloads.el (92%) rename elpa/{magit-popup-20160117.1513 => magit-popup-20160130.649}/magit-popup-pkg.el (67%) rename elpa/{magit-popup-20160117.1513 => magit-popup-20160130.649}/magit-popup.el (99%) rename elpa/{magit-popup-20160117.1513 => magit-popup-20160130.649}/magit-popup.info (100%) diff --git a/elpa/magit-20160117.2129/magit-popup.el b/elpa/magit-20160117.2129/magit-popup.el deleted file mode 100644 index 78c53539..00000000 --- a/elpa/magit-20160117.2129/magit-popup.el +++ /dev/null @@ -1,1264 +0,0 @@ -;;; magit-popup.el --- Define prefix-infix-suffix command combos -*- 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. - -;; This library was inspired by and replaces library `magit-key-mode', -;; which was written by Phil Jackson and is -;; distributed under the GNU General Public License version 3 or later. - -;; Author: Jonas Bernoulli -;; Maintainer: Jonas Bernoulli - -;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113")) -;; Keywords: bindings -;; Homepage: https://github.com/magit/magit - -;; 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 a generic interface for toggling switches -;; and setting options and then invoking an Emacs command which does -;; something with these arguments. The prototypical use is for the -;; command to call an external process, passing on the arguments as -;; command line arguments. But this is only one of many possible -;; uses (though the one this library is optimized for). - -;; With the Emacs concept of "prefix arguments" in mind this could be -;; described as "infix arguments with feedback in a buffer". - -;; Commands that set the prefix argument for the subsequent command do -;; not limit what that next command could be. But entering a command -;; console popup does limit the selection to the commands defined for -;; that popup, and so we use the term "infix" instead of "prefix". - -;;; Code: - -(require 'button) -(require 'cl-lib) -(require 'dash) -(require 'format-spec) - -(and (require 'async-bytecomp nil t) - (memq 'magit (bound-and-true-p async-bytecomp-allowed-packages)) - (fboundp 'async-bytecomp-package-mode) - (async-bytecomp-package-mode 1)) - -(declare-function info 'info) -(declare-function Man-find-section 'man) -(declare-function Man-next-section 'man) - -;; For the `:variable' event type. -(declare-function magit-call-git 'magit-process) -(declare-function magit-git-string 'magit-git) -(declare-function magit-refresh 'magit-mode) -(declare-function magit-set 'magit-git) - -;; For branch actions. -(declare-function magit-branch-set-face 'magit-git) -(declare-function magit-local-branch-p 'magit-git) - -;;; Settings -;;;; Custom Groups - -(defgroup magit-popup nil - "Infix arguments with a popup as feedback." - :group 'bindings) - -(defgroup magit-popup-faces nil - "Faces used by Magit-Popup." - :group 'magit-popup) - -;;;; Custom Options - -(defcustom magit-popup-display-buffer-action '((display-buffer-below-selected)) - "The action used to display a popup buffer. - -Popup buffers are displayed using `display-buffer' with the value -of this option as ACTION argument. You can also set this to nil -and instead add an entry to `display-buffer-alist'." - :package-version '(magit-popup . "2.4.0") - :group 'magit-popup - :type 'sexp) - -(defcustom magit-popup-manpage-package - (if (memq system-type '(windows-nt ms-dos)) 'woman 'man) - "The package used to display manpages. -One of `man' or `woman'." - :group 'magit-popup - :type '(choice (const man) (const woman))) - -(defcustom magit-popup-show-help-echo t - "Show usage information in the echo area." - :group 'magit-popup - :type 'boolean) - -(defcustom magit-popup-show-common-commands t - "Initially show section with commands common to all popups. -This section can also be toggled temporarily using \ -\\\\[magit-popup-toggle-show-common-commands]." - :group 'magit-popup - :type 'boolean) - -(defcustom magit-popup-use-prefix-argument 'disabled - "Control how prefix arguments affect infix argument popups. - -This option controls the effect that the use of a prefix argument -before entering a popup has. The *intended* default is `default', -but the *actual* default is `disabled'. This is necessary because -the old popup implementation did simply forward such a pre-popup -prefix argument to the action invoked from the popup, and changing -that without users being aware of it could lead to tears. - -`disabled' Bring up a Custom option buffer so that the user reads - this and then makes an informed choice. - -`default' With a prefix argument directly invoke the popup's - default action (an Emacs command), instead of bringing - up the popup. - -`popup' With a prefix argument bring up the popup, otherwise - directly invoke the popup's default action. - -`nil' Ignore prefix arguments." - :group 'magit-popup - :type '(choice - (const :tag "Call default action instead of showing popup" default) - (const :tag "Show popup instead of calling default action" popup) - (const :tag "Ignore prefix argument" nil) - (const :tag "Abort and show usage information" disabled))) - -;;;; Custom Faces - -(defface magit-popup-heading - '((t :inherit font-lock-keyword-face)) - "Face for key mode header lines." - :group 'magit-popup-faces) - -(defface magit-popup-key - '((t :inherit font-lock-builtin-face)) - "Face for key mode buttons." - :group 'magit-popup-faces) - -(defface magit-popup-argument - '((t :inherit font-lock-warning-face)) - "Face used to display enabled arguments in popups." - :group 'magit-popup-faces) - -(defface magit-popup-disabled-argument - '((t :inherit shadow)) - "Face used to display disabled arguments in popups." - :group 'magit-popup-faces) - -(defface magit-popup-option-value - '((t :inherit font-lock-string-face)) - "Face used to display option values in popups." - :group 'magit-popup-faces) - -;;;; Keymap - -(defvar magit-popup-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [remap self-insert-command] 'magit-invoke-popup-action) - (define-key map [?- t] 'magit-invoke-popup-switch) - (define-key map [?= t] 'magit-invoke-popup-option) - (define-key map [?\C-c ?\C-c] 'magit-popup-set-default-arguments) - (define-key map [?\C-x ?\C-s] 'magit-popup-save-default-arguments) - (define-key map [?\C-g] 'magit-popup-quit) - (define-key map [??] 'magit-popup-help) - (define-key map [?\C-h ?i] 'magit-popup-info) - (define-key map [?\C-t] 'magit-popup-toggle-show-common-commands) - (define-key map [?\d] 'backward-button) - (define-key map [?\C-p] 'backward-button) - (define-key map [?\t] 'forward-button) - (define-key map [?\C-n] 'forward-button) - (define-key map [?\r] 'push-button) - map) - "Keymap for `magit-popup-mode'. - -\\\ -This keymap contains bindings common to all popups. A section -listing these commands can be shown or hidden using \ -\\[magit-popup-toggle-show-common-commands]. - -The prefix used to toggle any switch can be changed by binding -another key to `magit-invoke-popup-switch'. Likewise binding -another key to `magit-invoke-popup-option' changes the prefixed -used to set any option. The two prefixes have to be different. -If you change these bindings you should also change the `prefix' -property of the button types `magit-popup-switch-button' and -`magit-popup-option-button'. - -If you change any other binding, then you might have to also edit -`magit-popup-common-commands' for things to align correctly in -the section listing these commands. - -Never bind an alphabetic character in this keymap or you might -make it impossible to invoke certain actions.") - -(defvar magit-popup-common-commands - '(("Set defaults" magit-popup-set-default-arguments) - ("View popup manual" magit-popup-info) - ("Toggle this section" magit-popup-toggle-show-common-commands) - ("Save defaults" magit-popup-save-default-arguments) - (" Popup help prefix" magit-popup-help) - ("Abort" magit-popup-quit))) - -;;;; Buttons - -(define-button-type 'magit-popup-button - 'face nil - 'action (lambda (button) - (funcall (button-get button 'function) - (button-get button 'event)))) - -(define-button-type 'magit-popup-switch-button - 'supertype 'magit-popup-button - 'function 'magit-invoke-popup-switch - 'property :switches - 'heading "Switches\n" - 'formatter 'magit-popup-format-argument-button - 'format " %k %d (%a)" - 'prefix ?- - 'maxcols 1) - -(define-button-type 'magit-popup-option-button - 'supertype 'magit-popup-button - 'function 'magit-invoke-popup-option - 'property :options - 'heading "Options\n" - 'formatter 'magit-popup-format-argument-button - 'format " %k %d (%a%v)" - 'prefix ?= - 'maxcols 1) - -(define-button-type 'magit-popup-variable-button - 'supertype 'magit-popup-button - 'function 'magit-invoke-popup-variable - 'property :variables - 'heading "Variables\n" - 'formatter 'magit-popup-format-variable-button - 'format " %k %d" - 'prefix nil - 'maxcols 1) - -(define-button-type 'magit-popup-action-button - 'supertype 'magit-popup-button - 'function 'magit-invoke-popup-action - 'property :actions - 'heading "Actions\n" - 'formatter 'magit-popup-format-action-button - 'format " %k %d" - 'prefix nil - 'maxcols :max-action-columns) - -(define-button-type 'magit-popup-command-button - 'supertype 'magit-popup-action-button - 'formatter 'magit-popup-format-command-button - 'action (lambda (button) - (let ((command (button-get button 'function))) - (unless (eq command 'push-button) - (call-interactively command))))) - -(define-button-type 'magit-popup-internal-command-button - 'supertype 'magit-popup-command-button - 'heading "Common Commands\n" - 'maxcols 3) - -;;; Events - -(defvar-local magit-this-popup nil - "The popup which is currently active. -This is intended for internal use only. -Don't confuse this with `magit-current-popup'.") - -(defvar-local magit-this-popup-events nil - "The events known to the active popup. -This is intended for internal use only. -Don't confuse this with `magit-current-popup-args'.") - -(defun magit-popup-get (prop) - "While a popup is active, get the value of PROP." - (if (memq prop '(:switches :options :variables :actions)) - (plist-get magit-this-popup-events prop) - (plist-get (symbol-value magit-this-popup) prop))) - -(defun magit-popup-put (prop val) - "While a popup is active, set the value of PROP to VAL." - (if (memq prop '(:switches :options :variables :actions)) - (setq magit-this-popup-events - (plist-put magit-this-popup-events prop val)) - (error "Property %s isn't supported" prop))) - -(defvar magit-current-popup nil - "The popup from which this editing command was invoked. - -Use this inside the `interactive' form of a popup aware command -to determine whether it was invoked from a popup and if so from -which popup. If the current command was invoked without the use -of a popup then this is nil.") - -(defvar magit-current-popup-args nil - "The value of the popup arguments for this editing command. - -If the current command was invoked from a popup, then this is -a list of strings of all the set switches and options. This -includes arguments which are set by default not only those -explicitly set during this invocation. - -When the value is nil, then that can be because no argument is -set, or because the current command wasn't invoked from a popup; -consult `magit-current-popup' to tell the difference. - -Generally it is better to use `NAME-arguments', which is created -by `magit-define-popup', instead of this variable or the function -by the same name, because `NAME-argument' uses the default value -for the arguments when the editing command is invoked directly -instead of from a popup. When the command is bound in several -popups that might not be feasible though.") - -(defun magit-current-popup-args (&rest filter) - "Return the value of the popup arguments for this editing command. - -The value is the same as that of the variable by the same name -\(which see), except that FILTER is applied. FILTER is a list -of regexps; only arguments that match one of them are returned. -The first element of FILTER may also be `:not' in which case -only arguments that don't match any of the regexps are returned, -or `:only' which doesn't change the behaviour." - (let ((-compare-fn (lambda (a b) (magit-popup-arg-match b a)))) - (-filter (if (eq (car filter) :not) - (lambda (arg) (not (-contains? (cdr filter) arg))) - (when (eq (car filter) :only) - (pop filter)) - (lambda (arg) (-contains? filter arg))) - magit-current-popup-args))) - -(defun magit-popup-arg-match (pattern string) - (if (or (string-match-p "=$" pattern) - (string-match-p "^-[A-Z]$" pattern)) - (string-match (format "^%s\\(.*\\)$" pattern) string) - (string-equal string pattern))) - -(cl-defstruct magit-popup-event key dsc arg fun use val) - -(defun magit-popup-event-keydsc (ev) - (let ((key (magit-popup-event-key ev))) - (key-description (if (vectorp key) key (vector key))))) - -(defun magit-popup-lookup (event type) - (--first (equal (magit-popup-event-key it) event) - (-filter 'magit-popup-event-p (magit-popup-get type)))) - -(defun magit-popup-get-args () - (--mapcat (when (and (magit-popup-event-p it) - (magit-popup-event-use it)) - (list (format "%s%s" - (magit-popup-event-arg it) - (or (magit-popup-event-val it) "")))) - (append (magit-popup-get :switches) - (magit-popup-get :options)))) - -(defmacro magit-popup-convert-events (def form) - (declare (indent 1) (debug (form form))) - `(--map (if (or (null it) (stringp it) (functionp it)) it ,form) ,def)) - -(defun magit-popup-convert-switches (val def) - (magit-popup-convert-events def - (let ((a (nth 2 it))) - (make-magit-popup-event - :key (car it) :dsc (cadr it) :arg a - :use (and (member a val) t))))) - -(defun magit-popup-convert-options (val def) - (magit-popup-convert-events def - (let* ((a (nth 2 it)) - (r (format "^%s\\(.*\\)" a)) - (v (--first (string-match r it) val))) - (make-magit-popup-event - :key (car it) :dsc (cadr it) :arg a - :use (and v t) :val (and v (match-string 1 v)) - :fun (or (nth 3 it) 'read-from-minibuffer))))) - -(defun magit-popup-convert-variables (_val def) - (magit-popup-convert-events def - (make-magit-popup-event - :key (car it) :dsc (cadr it) :fun (nth 2 it) :arg (nth 3 it)))) - -(defun magit-popup-convert-actions (_val def) - (magit-popup-convert-events def - (make-magit-popup-event - :key (car it) :dsc (cadr it) :fun (nth 2 it)))) - -;;; Define - -(defmacro magit-define-popup (name doc &rest args) - "Define a popup command named NAME. - -NAME should begin with the package prefix and by convention end -with `-popup'. That name is used for the actual command as well -as for a variable used internally. DOC is used as the doc-string -of that command. - -Also define an option and a function named `SHORTNAME-arguments', -where SHORTNAME is NAME with the trailing `-popup' removed. The -name of this option and this function can be overwritten using -the optional argument OPTION, but that is rarely advisable. As a -special case if OPTION is specified but nil, do not define this -option and this function at all. - -The option `SHORTNAME-arguments' holds the default value for the -popup arguments. It can be customized from within the popup or -using the Custom interface. - -The function `SHORTNAME-arguments' is a wrapper around the -variable `magit-current-popup-args', both of which are intended -to be used inside the `interactive' form of commands commonly -invoked from the popup `NAME'. When such a command is invoked -from that popup, then the function `SHORTNAME-arguments' returns -the value of the variable `magit-current-popup-args'; however -when the command is invoked directly, then it returns the default -value of the variable `SHORTNAME-arguments'. - -Optional argument GROUP specifies the Custom group in which the -option is placed. If omitted then the option is placed in some -group the same way it is done when directly using `defcustom'. - -Optional argument MODE is deprecated, instead use the keyword -arguments `:setup-function' and/or `:refresh-function'. If MODE -is non-nil, then it specifies the mode used by the popup buffer, -instead of the default, which is `magit-popup-mode'. - -The remaining arguments should have the form - - [KEYWORD VALUE]... - -The following keywords are meaningful (and by convention are -usually specified in that order): - -`:actions' - The actions which can be invoked from the popup. VALUE is a - list whose members have the form (KEY DESC COMMAND), see - `magit-define-popup-action' for details. - - Actions are regular Emacs commands, which usually have an - `interactive' form setup to consume the values of the popup - `:switches' and `:options' when invoked from the corresponding - popup, else when invoked as the default action or directly - without using the popup, the default value of the variable - `SHORTNAME-arguments'. This is usually done by calling the - function `SHORTNAME-arguments'. - - Members of VALUE may also be strings, assuming the first member - is also a string. Instead of just one action section with the - heading \"Actions\", multiple sections are then inserted into - the popup buffer, using these strings as headings. - - Members of VALUE may also be nil. This should only be used - together with `:max-action-columns' and allows having gaps in - the action grit, which can help arranging actions sensibly. - -`:default-action' - The default action of the popup which is used directly instead - of displaying the popup buffer, when the popup is invoked with - a prefix argument. Also see `magit-popup-use-prefix-argument' - and `:use-prefix', which can be used to inverse the meaning of - the prefix argument. - -`:use-prefix' - Controls when to display the popup buffer and when to invoke - the default action (if any) directly. This overrides the - global default set using `magit-popup-use-prefix-argument'. - The value, if specified, should be one of `default' or `popup'. - -`:max-action-columns' - The maximum number of actions to display on a single line. - This helps arranging actions more sensibly. If there is not - enough room to display that many actions on one line, then - this is ignored. - -`:switches' - The popup arguments which can be toggled on and off. VALUE - is a list whose members have the form (KEY DESC SWITCH), see - `magit-define-popup-switch' for details. - -`:options' - The popup arguments which take a value, as in \"--opt=OPTVAL\". - VALUE is a list whose members have the form (KEY DESC OPTION - READER), see `magit-define-popup-option' for details. - -`:default-arguments' - The default arguments, a list of switches (which are then - enabled by default) and options with there default values, as - in \"--OPT=OPTVAL\". - -`:sequence-predicate' - When this function returns non-nil, then the popup uses - `:sequence-actions' instead of `:actions', and does not show - the `:switches' and `:options'. - -`:sequence-actions' - The actions which can be invoked from the popup, when - `:sequence-predicate' returns non-nil. - -`:setup-function' - When this function is specified, then it is used instead of - `magit-popup-default-setup'. - -`:refresh-function' - When this function is specified, then it is used instead of - calling `magit-popup-insert-section' three times with symbols - `magit-popup-switch-button', `magit-popup-option-button', and - finally `magit-popup-action-button' as argument. - -`:man-page' - The name of the manpage to be displayed when the user requests - help for a switch or argument. - -\(fn NAME DOC [GROUP [MODE [OPTION]]] :KEYWORD VALUE...)" - (declare (indent defun) (doc-string 2)) - (let* ((grp (unless (keywordp (car args)) (pop args))) - (mode (unless (keywordp (car args)) (pop args))) - (opt (symbol-name name)) - (opt (if (keywordp (car args)) - (intern (concat (if (string-suffix-p "-popup" opt) - (substring opt 0 -6) - opt) - "-arguments")) - (eval (pop args))))) - `(progn - (defun ,name (&optional arg) ,doc - (interactive "P") - (magit-invoke-popup ',name ,mode arg)) - (defvar ,name - (list :variable ',opt ,@args)) - (magit-define-popup-keys-deferred ',name) - ,@(when opt - `((defcustom ,opt (plist-get ,name :default-arguments) - "" - ,@(and grp (list :group grp)) - :type '(repeat (string :tag "Argument"))) - (defun ,opt () - (if (eq magit-current-popup ',name) - magit-current-popup-args - ,opt)) - (put ',opt 'definition-name ',name)))))) - -(defun magit-define-popup-switch (popup key desc switch - &optional enable at prepend) - "In POPUP, define KEY as SWITCH. - -POPUP is a popup command defined using `magit-define-popup'. -SWITCH is a string representing an argument that takes no value. -KEY is a character representing the second event in the sequence -of keystrokes used to toggle the argument. (The first event, the -prefix, is shared among all switches, defaults to -, and can be -changed in `magit-popup-mode-keymap'). - -DESC is a string describing the purpose of the argument, it is -displayed in the popup. - -If optional ENABLE is non-nil then the switch is on by default. - -SWITCH is inserted after all other switches already defined for -POPUP, unless optional PREPEND is non-nil, in which case it is -placed first. If optional AT is non-nil then it should be the -KEY of another switch already defined for POPUP, the argument -is then placed before or after AT, depending on PREPEND." - (declare (indent defun)) - (magit-define-popup-key popup :switches key - (list desc switch enable) at prepend)) - -(defun magit-define-popup-option (popup key desc option - &optional reader value at prepend) - "In POPUP, define KEY as OPTION. - -POPUP is a popup command defined using `magit-define-popup'. -OPTION is a string representing an argument that takes a value. -KEY is a character representing the second event in the sequence -of keystrokes used to set the argument's value. (The first -event, the prefix, is shared among all options, defaults to =, -and can be changed in `magit-popup-mode-keymap'). - -DESC is a string describing the purpose of the argument, it is -displayed in the popup. - -If optional VALUE is non-nil then the option is on by default, -and VALUE is its default value. - -OPTION is inserted after all other options already defined for -POPUP, unless optional PREPEND is non-nil, in which case it is -placed first. If optional AT is non-nil then it should be the -KEY of another option already defined for POPUP, the argument -is then placed before or after AT, depending on PREPEND." - (declare (indent defun)) - (magit-define-popup-key popup :options key - (list desc option reader value) at prepend)) - -(defun magit-define-popup-variable (popup key desc command formatter - &optional at prepend) - "In POPUP, define KEY as COMMAND. - -POPUP is a popup command defined using `magit-define-popup'. -COMMAND is a command which calls `magit-popup-set-variable'. -FORMATTER is a function which calls `magit-popup-format-variable'. -These two functions have to be called with the same arguments. - -KEY is a character representing the event used interactively call -the COMMAND. - -DESC is the variable or a representation thereof. It's not -actually used for anything. - -COMMAND is inserted after all other commands already defined for -POPUP, unless optional PREPEND is non-nil, in which case it is -placed first. If optional AT is non-nil then it should be the -KEY of another command already defined for POPUP, the command -is then placed before or after AT, depending on PREPEND." - (declare (indent defun)) - (magit-define-popup-key popup :variables key - (list desc command formatter) at prepend)) - -(defun magit-define-popup-action (popup key desc command - &optional at prepend) - "In POPUP, define KEY as COMMAND. - -POPUP is a popup command defined using `magit-define-popup'. -COMMAND can be any command but should usually consume the popup -arguments in its `interactive' form. -KEY is a character representing the event used invoke the action, -i.e. to interactively call the COMMAND. - -DESC is a string describing the purpose of the action, it is -displayed in the popup. - -COMMAND is inserted after all other commands already defined for -POPUP, unless optional PREPEND is non-nil, in which case it is -placed first. If optional AT is non-nil then it should be the -KEY of another command already defined for POPUP, the command -is then placed before or after AT, depending on PREPEND." - (declare (indent defun)) - (magit-define-popup-key popup :actions key - (list desc command) at prepend)) - -(defun magit-define-popup-sequence-action - (popup key desc command &optional at prepend) - "Like `magit-define-popup-action' but for `:sequence-action'." - (declare (indent defun)) - (magit-define-popup-key popup :sequence-actions key - (list desc command) at prepend)) - -(defconst magit-popup-type-plural-alist - '((:switch . :switches) - (:option . :options) - (:variable . :variables) - (:action . :actions) - (:sequence-action . :sequence-actions))) - -(defun magit-popup-pluralize-type (type) - (or (cdr (assq type magit-popup-type-plural-alist)) - type)) - -(defun magit-define-popup-key - (popup type key def &optional at prepend) - "In POPUP, define KEY as an action, switch, or option. -It's better to use one of the specialized functions - `magit-define-popup-action', - `magit-define-popup-sequence-action', - `magit-define-popup-switch', - `magit-define-popup-option', or - `magit-define-popup-variable'." - (declare (indent defun)) - (setq type (magit-popup-pluralize-type type)) - (if (memq type '(:switches :options :variables :actions :sequence-actions)) - (if (boundp popup) - (let* ((plist (symbol-value popup)) - (value (plist-get plist type)) - (elt (assoc key value))) - (if elt - (setcdr elt def) - (setq elt (cons key def))) - (if at - (when (setq at (cl-member at value :key 'car-safe :test 'equal)) - (setq value (cl-delete key value :key 'car-safe :test 'equal)) - (if prepend - (progn (push (car at) (cdr at)) - (setcar at elt)) - (push elt (cdr at)))) - (setq value (cl-delete key value :key 'car-safe :test 'equal))) - (unless (assoc key value) - (setq value (if prepend - (cons elt value) - (append value (list elt))))) - (set popup (plist-put plist type value))) - (push (list type key def at prepend) - (get popup 'magit-popup-deferred))) - (error "Unknown popup event type: %s" type))) - -(defun magit-define-popup-keys-deferred (popup) - (dolist (args (get popup 'magit-popup-deferred)) - (condition-case err - (apply #'magit-define-popup-key popup args) - ((debug error) - (display-warning 'magit (error-message-string err) :error)))) - (put popup 'magit-popup-deferred nil)) - -(defun magit-change-popup-key (popup type from to) - "In POPUP, bind TO to what FROM was bound to. -TYPE is one of `:action', `:sequence-action', `:switch', or -`:option'. Bind TO and unbind FROM, both are characters." - (--if-let (assoc from (plist-get (symbol-value popup) - (magit-popup-pluralize-type type))) - (setcar it to) - (message "magit-change-popup-key: FROM key %c is unbound" from))) - -(defun magit-remove-popup-key (popup type key) - "In POPUP, remove KEY's binding of TYPE. -POPUP is a popup command defined using `magit-define-popup'. -TYPE is one of `:action', `:sequence-action', `:switch', or -`:option'. KEY is the character which is to be unbound." - (setq type (magit-popup-pluralize-type type)) - (let* ((plist (symbol-value popup)) - (alist (plist-get plist type)) - (value (assoc key alist))) - (set popup (plist-put plist type (delete value alist))))) - -;;; Invoke - -(defvar-local magit-popup-previous-winconf nil) - -(defun magit-invoke-popup (popup mode arg) - (let* ((def (symbol-value popup)) - (val (symbol-value (plist-get def :variable))) - (default (plist-get def :default-action)) - (local (plist-get def :use-prefix)) - (use-prefix (or local magit-popup-use-prefix-argument))) - (cond - ((and arg (eq magit-popup-use-prefix-argument 'disabled)) - (customize-option-other-window 'magit-popup-use-prefix-argument) - (error (concat "The meaning of prefix arguments has changed. " - "Please explicitly enable their use again."))) - ((or (and (eq use-prefix 'default) arg) - (and (eq use-prefix 'popup) (not arg))) - (if default - (let ((magit-current-popup (list popup 'default)) - (magit-current-popup-args - (let ((magit-this-popup popup) - (magit-this-popup-events nil)) - (magit-popup-default-setup val def) - (magit-popup-get-args)))) - (when (and arg (listp arg)) - (setq current-prefix-arg (and (not (= (car arg) 4)) - (list (/ (car arg) 4))))) - (call-interactively default)) - (message "%s has no default action; showing popup instead." popup) - (magit-popup-mode-setup popup mode))) - ((memq use-prefix '(disabled default popup nil)) - (magit-popup-mode-setup popup mode) - (when magit-popup-show-help-echo - (message (concat "Type C-h i to view popup manual, " - "? to describe an argument or action.")))) - (local - (error "Invalid :use-prefix popup property value: %s" use-prefix)) - (t - (error "Invalid magit-popup-use-prefix-argument value: %s" use-prefix))))) - -(defun magit-invoke-popup-switch (event) - (interactive (list last-command-event)) - (--if-let (magit-popup-lookup event :switches) - (progn - (setf (magit-popup-event-use it) - (not (magit-popup-event-use it))) - (magit-refresh-popup-buffer)) - (user-error "%c isn't bound to any switch" event))) - -(defun magit-invoke-popup-option (event) - (interactive (list last-command-event)) - (--if-let (magit-popup-lookup event :options) - (progn - (if (magit-popup-event-use it) - (setf (magit-popup-event-use it) nil) - (let* ((arg (magit-popup-event-arg it)) - (val (funcall - (magit-popup-event-fun it) - (concat arg (unless (string-match-p "=$" arg) ": ")) - (magit-popup-event-val it)))) - (setf (magit-popup-event-use it) t) - (setf (magit-popup-event-val it) val))) - (magit-refresh-popup-buffer)) - (user-error "%c isn't bound to any option" event))) - -(defun magit-invoke-popup-action (event) - (interactive (list last-command-event)) - (let ((action (magit-popup-lookup event :actions)) - (variable (magit-popup-lookup event :variables))) - (if (or action variable) - (let ((magit-current-popup magit-this-popup) - (magit-current-popup-args (magit-popup-get-args)) - (command (magit-popup-event-fun (or action variable)))) - (when action - (magit-popup-quit)) - (call-interactively command) - (setq this-command command) - (unless action - (magit-refresh-popup-buffer))) - (if (eq event ?q) - (magit-popup-quit) - (user-error "%c isn't bound to any action" event))))) - -(defun magit-popup-set-variable - (variable choices &optional default other) - (--if-let (--if-let (magit-git-string "config" "--local" variable) - (cadr (member it choices)) - (car choices)) - (magit-set it variable) - (magit-call-git "config" "--unset" 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) - (let ((winconf magit-popup-previous-winconf)) - (if (derived-mode-p 'magit-popup-mode) - (kill-buffer) - (magit-popup-help-mode -1) - (kill-local-variable 'magit-popup-previous-winconf)) - (when winconf - (set-window-configuration winconf)))) - -(defun magit-popup-read-number (prompt &optional default) - "Like `read-number' but DEFAULT may be a numeric string." - (read-number prompt (if (stringp default) - (string-to-number default) - default))) - -;;; Save - -(defun magit-popup-set-default-arguments (arg) - "Set default value for the arguments for the current popup. -Then close the popup without invoking an action; unless a prefix -argument is used in which case the popup remains open. - -For a popup named `NAME-popup' that usually means setting the -value of the custom option `NAME-arguments'." - (interactive "P") - (customize-set-variable (magit-popup-get :variable) - (magit-popup-get-args)) - (unless arg (magit-popup-quit))) - -(defun magit-popup-save-default-arguments (arg) - "Save default value for the arguments for the current popup. -Then close the popup without invoking an action; unless a prefix -argument is used in which case the popup remains open. - -For a popup named `NAME-popup' that usually means saving the -value of the custom option `NAME-arguments'." - (interactive "P") - (customize-save-variable (magit-popup-get :variable) - (magit-popup-get-args)) - (unless arg (magit-popup-quit))) - -;;; Help - -(defun magit-popup-toggle-show-common-commands () - "Show or hide an additional section with common commands. -The commands listed in this section are common to all popups -and are defined in `magit-popup-mode-map' (which see)." - (interactive) - (setq magit-popup-show-common-commands - (not magit-popup-show-common-commands)) - (magit-refresh-popup-buffer) - (fit-window-to-buffer)) - -(defun magit-popup-help () - "Show help for the argument or action at point." - (interactive) - (let* ((man (magit-popup-get :man-page)) - (key (read-key-sequence - (concat "Describe key" (and man " (? for manpage)") ": "))) - (int (aref key (1- (length key)))) - (def (or (lookup-key (current-local-map) key t) - (lookup-key (current-global-map) key)))) - (pcase def - (`magit-invoke-popup-switch - (magit-popup-manpage man (magit-popup-lookup int :switches))) - (`magit-invoke-popup-option - (magit-popup-manpage man (magit-popup-lookup int :options))) - (`magit-popup-help - (magit-popup-manpage man nil)) - ((or `self-insert-command - `magit-invoke-popup-action) - (setq def (or (magit-popup-lookup int :actions) - (magit-popup-lookup int :variables))) - (if def - (magit-popup-describe-function (magit-popup-event-fun def)) - (ding) - (message nil))) - (`nil (ding) - (message nil)) - (_ (magit-popup-describe-function def))))) - -(defun magit-popup-manpage (topic arg) - (unless topic - (user-error "No man page associated with %s" - (magit-popup-get :man-page))) - (when arg - (setq arg (magit-popup-event-arg arg))) - (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)) - (woman topic))) - (setq buffer (current-buffer))) - (`man (cl-letf (((symbol-function #'fboundp) (lambda (_) nil))) - (setq buffer (man topic))) - (delete-other-windows) - (split-window-below) - (set-window-buffer (selected-window) buffer))) - (with-current-buffer buffer - (setq magit-popup-previous-winconf winconf) - (magit-popup-help-mode) - (fit-window-to-buffer (next-window)) - (if (and arg - (Man-find-section "OPTIONS") - (re-search-forward (format "^[\t\s]+\\(-., \\)*?%s[=\n]" arg) - (save-excursion - (Man-next-section 1) - (point)) - t)) - (goto-char (1+ (match-beginning 0))) - (goto-char (point-min)))))) - -(defun magit-popup-describe-function (function) - (let ((winconf (current-window-configuration))) - (delete-other-windows) - (split-window-below) - (other-window 1) - (with-no-warnings ; display-buffer-function is obsolete - (let ((display-buffer-alist nil) - (display-buffer-function nil)) - (describe-function function))) - (fit-window-to-buffer) - (other-window 1) - (setq magit-popup-previous-winconf winconf) - (magit-popup-help-mode))) - -(defun magit-popup-info () - "Show the popup manual." - (interactive) - (let ((winconf (current-window-configuration))) - (delete-other-windows) - (split-window-below) - (info "(magit-popup.info)Usage") - (magit-popup-help-mode) - (setq magit-popup-previous-winconf winconf)) - (magit-popup-help-mode) - (fit-window-to-buffer (next-window))) - -(define-minor-mode magit-popup-help-mode - "Auxiliary minor mode used to restore previous window configuration. -When some sort of help buffer is created from within a popup, -then this minor mode is turned on in that buffer, so that when -the user quits it, the previous window configuration is also -restored." - :keymap '(([remap Man-quit] . magit-popup-quit) - ([remap Info-exit] . magit-popup-quit) - ([remap quit-window] . magit-popup-quit))) - -;;; Modes - -(define-derived-mode magit-popup-mode fundamental-mode "MagitPopup" - "Major mode for infix argument popups." - :mode 'magit-popup - (setq truncate-lines t) - (setq buffer-read-only t) - (setq-local scroll-margin 0) - (setq-local magit-popup-show-common-commands magit-popup-show-common-commands) - (hack-dir-local-variables-non-file-buffer)) - -(put 'magit-popup-mode 'mode-class 'special) - -(defun magit-popup-default-setup (val def) - (if (--when-let (magit-popup-get :sequence-predicate) - (funcall it)) - (magit-popup-put :actions (magit-popup-convert-actions - val (magit-popup-get :sequence-actions))) - (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))))) - -(defun magit-popup-mode-setup (popup mode) - (let ((val (symbol-value (plist-get (symbol-value popup) :variable))) - (def (symbol-value popup))) - (magit-popup-mode-display-buffer (get-buffer-create - (format "*%s*" popup)) - (or mode 'magit-popup-mode)) - (setq magit-this-popup popup) - (if (bound-and-true-p magit-popup-setup-hook) ; obsolete - (run-hook-with-args 'magit-popup-setup-hook val def) - (funcall (or (magit-popup-get :setup-function) - 'magit-popup-default-setup) - val def))) - (magit-refresh-popup-buffer) - (fit-window-to-buffer nil nil (line-number-at-pos (point-max)))) - -(defun magit-popup-mode-display-buffer (buffer mode) - (let ((winconf (current-window-configuration))) - (select-window (display-buffer buffer magit-popup-display-buffer-action)) - (funcall mode) - (setq magit-popup-previous-winconf winconf))) - -(defvar magit-refresh-popup-buffer-hook nil - "Hook run by `magit-refresh-popup-buffer'. - -The hook is run right after inserting the representation of the -popup events but before optionally inserting the representation -of events shared by all popups and before point is adjusted.") - -(defun magit-refresh-popup-buffer () - (let* ((inhibit-read-only t) - (button (button-at (point))) - (prefix (and button (button-get button 'prefix))) - (event (and button (button-get button 'event)))) - (erase-buffer) - (save-excursion - (--if-let (magit-popup-get :refresh-function) - (funcall it) - (magit-popup-insert-section 'magit-popup-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 - (magit-popup-insert-command-section - 'magit-popup-internal-command-button - magit-popup-common-commands))) - (set-buffer-modified-p nil) - (when event - (while (and (ignore-errors (forward-button 1)) - (let ((b (button-at (point)))) - (or (not (equal (button-get b 'prefix) prefix)) - (not (equal (button-get b 'event) event))))))))) - -;;; Draw - -(defvar magit-popup-min-padding 3 - "Minimal amount of whitespace between columns in popup buffers.") - -(defun magit-popup-insert-section (type &optional spec heading) - (if (not spec) - (progn (setq spec (magit-popup-get (button-type-get type 'property))) - (when spec - (if (or (stringp (car spec)) - (functionp (car spec))) - (--each (--partition-by-header - (or (stringp it) (functionp it)) - spec) - (magit-popup-insert-section type (cdr it) (car it))) - (magit-popup-insert-section type spec)))) - (let* ((formatter (button-type-get type 'formatter)) - (items (mapcar (lambda (ev) - (and ev (or (funcall formatter type ev) '("")))) - (or spec (magit-popup-get - (button-type-get type 'property))))) - (maxcols (button-type-get type 'maxcols)) - (pred (magit-popup-get :sequence-predicate))) - (if (and pred (funcall pred)) - (setq maxcols nil) - (cl-typecase maxcols - (keyword (setq maxcols (magit-popup-get maxcols))) - (symbol (setq maxcols (symbol-value maxcols))))) - (when items - (if (functionp heading) - (when (setq heading (funcall heading)) - (insert heading ?\n)) - (unless heading - (setq heading (button-type-get type 'heading))) - (insert (propertize heading 'face 'magit-popup-heading)) - (unless (string-match "\n$" heading) - (insert "\n"))) - (when heading - (let ((colwidth - (+ (apply 'max (mapcar (lambda (e) (length (car e))) items)) - magit-popup-min-padding))) - (dolist (item items) - (unless (bolp) - (let ((padding (- colwidth (% (current-column) colwidth)))) - (if (and (< (+ (current-column) padding colwidth) - (window-width)) - (< (ceiling (/ (current-column) (* colwidth 1.0))) - (or maxcols 1000))) - (insert (make-string padding ?\s)) - (insert "\n")))) - (unless (equal item '("")) - (if item - (apply 'insert-button item) - (insert ?\s))))) - (insert (if (= (char-before) ?\n) "\n" "\n\n"))))))) - -(defun magit-popup-format-argument-button (type ev) - (list (format-spec - (button-type-get type 'format) - `((?k . ,(propertize (concat - (--when-let (button-type-get type 'prefix) - (char-to-string it)) - (magit-popup-event-keydsc ev)) - 'face 'magit-popup-key)) - (?d . ,(magit-popup-event-dsc ev)) - (?a . ,(propertize (magit-popup-event-arg ev) - 'face (if (magit-popup-event-use ev) - 'magit-popup-argument - 'magit-popup-disabled-argument))) - (?v . ,(let ((val (magit-popup-event-val ev))) - (if (and (magit-popup-event-use ev) - (not (equal val ""))) - (propertize (format "\"%s\"" val) - 'face 'magit-popup-option-value) - ""))))) - 'type type 'event (magit-popup-event-key ev))) - -(defun magit-popup-format-variable-button (type ev) - (list (format-spec - (button-type-get type 'format) - `((?k . ,(propertize (magit-popup-event-keydsc ev) - 'face 'magit-popup-key)) - (?d . ,(funcall (magit-popup-event-arg ev))))) - 'type type 'event (magit-popup-event-key ev))) - -(defun magit-popup-format-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) - (let ((local (magit-git-string "config" "--local" variable)) - (global (magit-git-string "config" "--global" variable))) - (when other - (--if-let (magit-git-string "config" other) - (setq other (concat other ":" it)) - (setq other nil))) - (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)) - branch - (magit-branch-set-face branch))))) - (when dsc - (list (format-spec - (button-type-get type 'format) - `((?k . ,(propertize (magit-popup-event-keydsc ev) - 'face 'magit-popup-key)) - (?d . ,dsc) - (?D . ,(if (and (not fun) - (eq (magit-popup-event-fun ev) - (magit-popup-get :default-action))) - (propertize dsc 'face 'bold) - dsc)))) - 'type type 'event (magit-popup-event-key ev))))) - -(defun magit-popup-insert-command-section (type spec) - (magit-popup-insert-section - type (mapcar (lambda (elt) - (list (car (where-is-internal (cadr elt) - (current-local-map))) - (car elt))) - spec))) - -(defun magit-popup-format-command-button (type elt) - (nconc (magit-popup-format-action-button - type (make-magit-popup-event :key (car elt) - :dsc (cadr elt))) - (list 'function (lookup-key (current-local-map) (car elt))))) - -;;; Utilities - -(defun magit-popup-import-file-args (args files) - (if files - (cons (concat "-- " (mapconcat #'identity files ",")) args) - args)) - -(defun magit-popup-export-file-args (args) - (let ((files (--first (string-prefix-p "-- " it) args))) - (when files - (setq args (remove files args) - files (split-string (substring files 3) ","))) - (list args files))) - -;;; magit-popup.el ends soon - -(defconst magit-popup-font-lock-keywords - (eval-when-compile - `((,(concat "(\\(magit-define-popup\\)\\_>" - "[ \t'\(]*" - "\\(\\(?:\\sw\\|\\s_\\)+\\)?") - (1 'font-lock-keyword-face) - (2 'font-lock-function-name-face nil t))))) - -(font-lock-add-keywords 'emacs-lisp-mode magit-popup-font-lock-keywords) - -(provide 'magit-popup) -;; Local Variables: -;; indent-tabs-mode: nil -;; End: -;;; magit-popup.el ends here diff --git a/elpa/magit-20160117.2129/magit.info b/elpa/magit-20160117.2129/magit.info deleted file mode 100644 index 8d5f70cd..00000000 --- a/elpa/magit-20160117.2129/magit.info +++ /dev/null @@ -1,163 +0,0 @@ -This is magit.info, produced by makeinfo version 5.2 from magit.texi. - -Magit is an interface to the version control system Git, implemented as -an Emacs package. Magit aspires to be a complete Git porcelain. While -we cannot (yet) claim that Magit wraps and improves upon each and every -Git command, it is complete enough to allow even experienced Git users -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. - - Copyright (C) 2015-2016 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: 1222 -magit.info-2: 309520 - -Tag Table: -(Indirect) -Node: Top1222 -Node: Introduction5928 -Node: Installation10621 -Node: Updating from an older release10996 -Node: Installing from an Elpa archive12591 -Node: Installing from the Git repository14149 -Node: Post-installation tasks16388 -Node: Getting started17777 -Node: Interface concepts23512 -Node: Modes and Buffers23786 -Node: Switching Buffers25532 -Node: Naming Buffers28596 -Node: Quitting Windows31431 -Node: Automatic Refreshing of Magit Buffers33063 -Node: Automatic Saving of File-Visiting Buffers35831 -Node: Automatic Reverting of File-Visiting Buffers37016 -Node: Risk of Reverting Automatically40866 -Node: Sections43249 -Node: Section movement44190 -Node: Section visibility48117 -Node: Section hooks51708 -Node: Section types and values53989 -Node: Section options55259 -Node: Popup buffers and prefix commands55731 -Node: Completion and confirmation57045 -Node: Running Git59951 -Node: Viewing Git output60187 -Node: Running Git manually61187 -Node: Git executable63313 -Node: Global Git arguments65320 -Node: Inspecting66127 -Node: Status buffer67254 -Node: Status sections69777 -Node: Status header sections74524 -Node: Status options77083 -Node: Logging77807 -Node: Refreshing logs80174 -Node: Log Buffer81559 -Node: Select from log84648 -Node: Reflog85588 -Node: Diffing86066 -Node: Refreshing diffs88878 -Node: Diff buffer91859 -Node: Diff options93761 -Node: Revision buffer95393 -Node: Ediffing96348 -Node: References buffer99397 -Node: References sections104107 -Node: Bisecting104982 -Node: Visiting blobs106478 -Node: Blaming106987 -Node: Manipulating110307 -Node: Repository setup110599 -Node: Staging and unstaging111639 -Node: Staging from file-visiting buffers113988 -Node: Applying115156 -Node: Committing116799 -Node: Initiating a commit117382 -Node: Editing commit messages120694 -Node: Branching131090 -Node: Merging143379 -Node: Rebasing145463 -Node: Editing rebase sequences148411 -Node: Rebase sequence log151445 -Node: Cherry picking158189 -Node: Reverting159795 -Node: Resetting161158 -Node: Stashing162668 -Node: Transferring165813 -Node: Remotes166051 -Node: Fetching167337 -Node: Pulling168314 -Node: Pushing169040 -Node: Creating and sending patches173369 -Node: Applying patches174064 -Node: Miscellaneous175062 -Node: Tagging175353 -Node: Notes176138 -Node: Submodules178663 -Node: Common commands179983 -Node: Wip modes181731 -Node: Minor mode for buffers visiting files188467 -Node: Minor mode for buffers visiting blobs190610 -Node: Customizing191415 -Node: Per-repository configuration193087 -Node: Essential settings194721 -Node: Safety195045 -Node: Performance196878 -Node: Plumbing202144 -Node: Calling Git202772 -Node: Getting a value from Git204295 -Node: Calling Git for effect207399 -Node: Section plumbing213903 -Node: Creating sections214131 -Node: Section selection217934 -Node: Matching sections219614 -Node: Refreshing buffers224816 -Node: Conventions227951 -Node: Confirmation and completion228128 -Node: Theming Faces229026 -Node: FAQ237177 -Node: Magit is slow238510 -Node: I changed several thousand files at once and now Magit is unusable238711 -Node: I am having problems committing239427 -Node: I don't understand how branching and pushing work239885 -Node: I don't like the key binding in v24240254 -Node: I cannot install the pre-requisites for Magit v2240593 -Node: I am using an Emacs release older than v244241058 -Node: I am using a Git release older than v194242671 -Node: I am using MS Windows and cannot push with Magit243658 -Node: How to install the gitman info manual?244237 -Node: How can I show Git's output?246765 -Node: Expanding a file to show the diff causes it to disappear247577 -Node: Point is wrong in the COMMIT_EDITMSG buffer248103 -Node: Can Magit be used as ediff-version-control-package?249121 -Node: How to show diffs for gpg-encrypted files?251145 -Node: Emacs 245 hangs when loading Magit251736 -Node: Symbol's value as function is void --some252305 -Node: Where is the branch manager252625 -Node: Keystroke Index252910 -Node: Command Index280119 -Node: Function Index309520 -Node: Variable Index321303 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20160117.2129/AUTHORS.md b/elpa/magit-20160211.2105/AUTHORS.md similarity index 99% rename from elpa/magit-20160117.2129/AUTHORS.md rename to elpa/magit-20160211.2105/AUTHORS.md index 1ca91429..9dff8612 100644 --- a/elpa/magit-20160117.2129/AUTHORS.md +++ b/elpa/magit-20160211.2105/AUTHORS.md @@ -45,7 +45,7 @@ Contributors - Adeodato Simó - Ævar Arnfjörð Bjarmason - Alan Falloon -- Alex Dunn +- Alex Dunn - Alexey Voinov - Alex Kost - Alex Ott diff --git a/elpa/magit-20160117.2129/COPYING b/elpa/magit-20160211.2105/COPYING similarity index 100% rename from elpa/magit-20160117.2129/COPYING rename to elpa/magit-20160211.2105/COPYING diff --git a/elpa/magit-20160117.2129/dir b/elpa/magit-20160211.2105/dir similarity index 100% rename from elpa/magit-20160117.2129/dir rename to elpa/magit-20160211.2105/dir diff --git a/elpa/magit-20160117.2129/git-rebase.el b/elpa/magit-20160211.2105/git-rebase.el similarity index 100% rename from elpa/magit-20160117.2129/git-rebase.el rename to elpa/magit-20160211.2105/git-rebase.el diff --git a/elpa/magit-20160117.2129/magit-apply.el b/elpa/magit-20160211.2105/magit-apply.el similarity index 92% rename from elpa/magit-20160117.2129/magit-apply.el rename to elpa/magit-20160211.2105/magit-apply.el index 554a1950..996ee8a3 100644 --- a/elpa/magit-20160117.2129/magit-apply.el +++ b/elpa/magit-20160211.2105/magit-apply.el @@ -52,6 +52,22 @@ :group 'magit :type 'boolean) +(defcustom magit-unstage-committed t + "Whether unstaging a committed change reverts it instead. + +A committed change cannot be unstaged, because staging and +unstaging are actions that are concern with the differences +between the index and the working tree, not with committed +changes. + +If this option is non-nil (the default), then typing \"u\" +(`magit-unstage') on a committed change, causes it to be +reversed in the index but not the working tree. For more +information see command `magit-reverse-in-index'." + :package-version '(magit . "2.4.1") + :group 'magit-commands + :type 'boolean) + ;;; Commands ;;;; Apply @@ -129,10 +145,10 @@ With a prefix argument and if necessary, attempt a 3-way merge." (magit-wip-commit-before-change files (concat " before " command))) (with-temp-buffer (insert patch) - (magit-run-git-with-input nil - "apply" args "-p0" - (unless (magit-diff-context-p) "--unidiff-zero") - "--ignore-space-change" "-")) + (magit-run-git-with-input + "apply" args "-p0" + (unless (magit-diff-context-p) "--unidiff-zero") + "--ignore-space-change" "-")) (unless inhibit-magit-refresh (when magit-wip-after-apply-mode (magit-wip-commit-after-apply files (concat " after " command))) @@ -256,8 +272,8 @@ ignored) files. (`(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 (bound-and-true-p magit-unstage-use-anti-stage) - (magit-anti-stage) + (`(committed ,_) (if magit-unstage-committed + (magit-reverse-in-index) (user-error "Cannot unstage committed changes"))) (`(undefined ,_) (user-error "Cannot unstage this change"))))) @@ -516,6 +532,25 @@ without requiring confirmation." (when binaries (user-error "Cannot reverse binary files")))) +(defun magit-reverse-in-index (&rest args) + "Reverse the change at point in the index but not the working tree. + +Use this command to extract a change from `HEAD', while leaving +it in the working tree, so that it can later be committed using +a separate commit. A typical workflow would be: + +0. Optionally make sure that there are no uncommitted changes. +1. Visit the `HEAD' commit and navigate to the change that should + not have been included in that commit. +2. Type \"u\" (`magit-unstage') to reverse it in the index. + This assumes that `magit-unstage-committed-changes' is non-nil. +3. Type \"c e\" to extend `HEAD' with the staged changes, + including those that were already staged before. +4. Optionally stage the remaining changes using \"s\" or \"S\" + and then type \"c c\" to create a new commit." + (interactive) + (magit-reverse (cons "--cached" args))) + ;;; magit-apply.el ends soon (provide 'magit-apply) ;; Local Variables: diff --git a/elpa/magit-20160117.2129/magit-autoloads.el b/elpa/magit-20160211.2105/magit-autoloads.el similarity index 94% rename from elpa/magit-20160117.2129/magit-autoloads.el rename to elpa/magit-20160211.2105/magit-autoloads.el index 5ce48506..81762d12 100644 --- a/elpa/magit-20160117.2129/magit-autoloads.el +++ b/elpa/magit-20160211.2105/magit-autoloads.el @@ -3,8 +3,7 @@ ;;; Code: (add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads nil "git-rebase" "git-rebase.el" (22173 11926 0 -;;;;;; 0)) +;;;### (autoloads nil "git-rebase" "git-rebase.el" (22206 293 0 0)) ;;; Generated autoloads from git-rebase.el (autoload 'git-rebase-mode "git-rebase" "\ @@ -23,7 +22,7 @@ running 'man git-rebase' at the command line) for details. ;;;*** -;;;### (autoloads nil "magit" "magit.el" (22173 11926 0 0)) +;;;### (autoloads nil "magit" "magit.el" (22206 293 0 0)) ;;; Generated autoloads from magit.el (autoload 'magit-status "magit" "\ @@ -147,9 +146,6 @@ of the new branch, instead of the starting-point itself. (autoload 'magit-branch-reset "magit" "\ Reset a branch to the tip of another branch or any other commit. -When resetting to another branch, then also set that branch as -the upstream of the branch being reset. - When the branch being reset is the current branch, then do a hard reset. If there are any uncommitted changes, then the user has to confirming the reset because those changes would be lost. @@ -157,7 +153,11 @@ has to confirming the reset because those changes would be lost. This is useful when you have started work on a feature branch but realize it's all crap and want to start over. -\(fn BRANCH TO &optional ARGS)" t nil) +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. + +\(fn BRANCH TO &optional ARGS SET-UPSTREAM)" t nil) (autoload 'magit-branch-delete "magit" "\ Delete one or multiple branches. @@ -396,47 +396,6 @@ defaulting to the tag at point. \(fn TAGS)" t nil) (autoload 'magit-notes-popup "magit" nil t) - (autoload 'magit-submodule-popup "magit" nil t) - -(autoload 'magit-submodule-add "magit" "\ -Add the repository at URL as a submodule. -Optional PATH is the path to the submodule relative to the root -of the superproject. If it is nil then the path is determined -based on URL. - -\(fn URL &optional PATH)" t nil) - -(autoload 'magit-submodule-setup "magit" "\ -Clone and register missing submodules and checkout appropriate commits. - -\(fn)" t nil) - -(autoload 'magit-submodule-init "magit" "\ -Register submodules listed in \".gitmodules\" into \".git/config\". - -\(fn)" t nil) - -(autoload 'magit-submodule-update "magit" "\ -Clone missing submodules and checkout appropriate commits. -With a prefix argument also register submodules in \".git/config\". - -\(fn &optional INIT)" t nil) - -(autoload 'magit-submodule-sync "magit" "\ -Update each submodule's remote URL according to \".gitmodules\". - -\(fn)" t nil) - -(autoload 'magit-submodule-fetch "magit" "\ -Fetch all submodules. -With a prefix argument fetch all remotes. - -\(fn &optional ALL)" t nil) - -(autoload 'magit-submodule-deinit "magit" "\ -Unregister the submodule at PATH. - -\(fn PATH)" t nil) (defvar global-magit-file-mode nil "\ Non-nil if Global-Magit-File mode is enabled. @@ -496,8 +455,8 @@ Git, and Emacs in the echo area. ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (22173 11926 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-apply" "magit-apply.el" (22206 293 0 +;;;;;; 0)) ;;; Generated autoloads from magit-apply.el (autoload 'magit-stage-file "magit-apply" "\ @@ -533,8 +492,8 @@ Remove all changes from the staging area. ;;;*** -;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (22173 -;;;;;; 11926 0 0)) +;;;### (autoloads nil "magit-autorevert" "magit-autorevert.el" (22206 +;;;;;; 293 0 0)) ;;; Generated autoloads from magit-autorevert.el (defvar magit-revert-buffers t) @@ -562,7 +521,7 @@ See `auto-revert-mode' for more information on Auto-Revert mode. ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22173 11926 +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22206 293 ;;;;;; 0 0)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect-popup "magit-bisect" nil t) @@ -614,8 +573,8 @@ bisect run'. ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (22173 11926 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-blame" "magit-blame.el" (22206 293 0 +;;;;;; 0)) ;;; Generated autoloads from magit-blame.el (autoload 'magit-blame-popup "magit-blame" nil t) @@ -639,7 +598,7 @@ only arguments available from `magit-blame-popup' should be used. ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (22173 11926 +;;;### (autoloads nil "magit-commit" "magit-commit.el" (22206 293 ;;;;;; 0 0)) ;;; Generated autoloads from magit-commit.el @@ -722,8 +681,7 @@ Create a squash commit targeting COMMIT and instantly rebase. ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (22173 11926 0 -;;;;;; 0)) +;;;### (autoloads nil "magit-diff" "magit-diff.el" (22206 293 0 0)) ;;; Generated autoloads from magit-diff.el (autoload 'magit-diff-dwim "magit-diff" "\ @@ -788,8 +746,8 @@ for a revision. ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22173 11926 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22206 293 0 +;;;;;; 0)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff-popup "magit-ediff" nil t) @@ -869,7 +827,7 @@ Show changes introduced by COMMIT using Ediff. ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (22173 11926 +;;;### (autoloads nil "magit-extras" "magit-extras.el" (22206 293 ;;;;;; 0 0)) ;;; Generated autoloads from magit-extras.el @@ -940,7 +898,7 @@ on a position in a file-visiting buffer. ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (22173 11926 0 0)) +;;;### (autoloads nil "magit-log" "magit-log.el" (22206 293 0 0)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log-current "magit-log" "\ @@ -1008,7 +966,7 @@ Show commits in a branch that are not merged in the upstream branch. ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (22173 11926 +;;;### (autoloads nil "magit-remote" "magit-remote.el" (22206 293 ;;;;;; 0 0)) ;;; Generated autoloads from magit-remote.el @@ -1037,6 +995,21 @@ Change the url of the remote named REMOTE to URL. (autoload 'magit-remote-remove "magit-remote" "\ Delete the remote named REMOTE. +\(fn REMOTE)" t nil) + +(autoload 'magit-remote-set-head "magit-remote" "\ +Set the local representation of REMOTE's default branch. +Query REMOTE and set the symbolic-ref refs/remotes//HEAD +accordingly. With a prefix argument query for the branch to be +used, which allows you to select an incorrect value if you fancy +doing that. + +\(fn REMOTE &optional BRANCH)" t nil) + +(autoload 'magit-remote-unset-head "magit-remote" "\ +Unset the local representation of REMOTE's default branch. +Delete the symbolic-ref \"refs/remotes//HEAD\". + \(fn REMOTE)" t nil) (autoload 'magit-fetch-popup "magit-remote" nil t) @@ -1207,8 +1180,8 @@ is asked to pull. START has to be reachable from that commit. ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22173 -;;;;;; 11926 0 0)) +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22206 +;;;;;; 293 0 0)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1356,8 +1329,8 @@ Abort the current rebase operation, restoring the original branch. ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (22173 11926 -;;;;;; 0 0)) +;;;### (autoloads nil "magit-stash" "magit-stash.el" (22206 293 0 +;;;;;; 0)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash-popup "magit-stash" nil t) @@ -1456,7 +1429,71 @@ Show all diffs of a stash in a buffer. ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (22173 11926 0 0)) +;;;### (autoloads nil "magit-submodule" "magit-submodule.el" (22206 +;;;;;; 293 0 0)) +;;; Generated autoloads from magit-submodule.el + (autoload 'magit-submodule-popup "magit-submodule" nil t) + +(autoload 'magit-submodule-add "magit-submodule" "\ +Add the repository at URL as a submodule. +Optional PATH is the path to the submodule relative to the root +of the superproject. If it is nil then the path is determined +based on URL. + +\(fn URL &optional PATH)" t nil) + +(autoload 'magit-submodule-setup "magit-submodule" "\ +Clone and register missing submodules and checkout appropriate commits. + +\(fn)" t nil) + +(autoload 'magit-submodule-init "magit-submodule" "\ +Register submodules listed in \".gitmodules\" into \".git/config\". + +\(fn)" t nil) + +(autoload 'magit-submodule-update "magit-submodule" "\ +Clone missing submodules and checkout appropriate commits. +With a prefix argument also register submodules in \".git/config\". + +\(fn &optional INIT)" t nil) + +(autoload 'magit-submodule-sync "magit-submodule" "\ +Update each submodule's remote URL according to \".gitmodules\". + +\(fn)" t nil) + +(autoload 'magit-submodule-fetch "magit-submodule" "\ +Fetch all submodules. +With a prefix argument fetch all remotes. + +\(fn &optional ALL)" t nil) + +(autoload 'magit-submodule-deinit "magit-submodule" "\ +Unregister the submodule at PATH. + +\(fn PATH)" t nil) + +(autoload 'magit-insert-submodule-commits "magit-submodule" "\ +For internal use, don't add to a hook. + +\(fn SECTION RANGE)" nil nil) + +(autoload 'magit-insert-unpulled-module-commits "magit-submodule" "\ +Insert sections for all submodules with unpulled commits. +These sections can be expanded to show the respective commits. + +\(fn)" nil nil) + +(autoload 'magit-insert-unpushed-module-commits "magit-submodule" "\ +Insert sections for all submodules with unpushed commits. +These sections can be expanded to show the respective commits. + +\(fn)" nil nil) + +;;;*** + +;;;### (autoloads nil "magit-wip" "magit-wip.el" (22206 293 0 0)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -1522,8 +1559,8 @@ command which is about to be called are committed. ;;;*** ;;;### (autoloads nil nil ("magit-core.el" "magit-git.el" "magit-mode.el" -;;;;;; "magit-pkg.el" "magit-popup.el" "magit-process.el" "magit-section.el" -;;;;;; "magit-utils.el") (22173 11926 589100 0)) +;;;;;; "magit-pkg.el" "magit-process.el" "magit-section.el" "magit-utils.el") +;;;;;; (22206 293 291654 0)) ;;;*** diff --git a/elpa/magit-20160117.2129/magit-autorevert.el b/elpa/magit-20160211.2105/magit-autorevert.el similarity index 59% rename from elpa/magit-20160117.2129/magit-autorevert.el rename to elpa/magit-20160211.2105/magit-autorevert.el index fa7555db..6ca2aefa 100644 --- a/elpa/magit-20160117.2129/magit-autorevert.el +++ b/elpa/magit-20160211.2105/magit-autorevert.el @@ -1,4 +1,4 @@ -;;; magit-autorevert.el --- revert buffers when files in Git repositories change -*- lexical-binding: t -*- +;;; magit-autorevert.el --- revert buffers when files in repository change -*- lexical-binding: t -*- ;; Copyright (C) 2010-2016 The Magit Project Contributors ;; @@ -30,10 +30,41 @@ (require 'autorevert) +(defgroup magit-auto-revert nil + "Revert buffers when files in repository change." + :group 'auto-revert + :group 'magit-extensions) + +(defcustom auto-revert-buffer-list-filter nil + "Filter that determines which buffers `auto-revert-buffers' reverts. + +This option is provided by `magit', which also redefines +`auto-revert-buffers' to respect it. Magit users who do not turn +on the local mode `auto-revert-mode' themselves, are best served +by setting the value to `magit-auto-revert-repository-buffers-p'. + +However the default is nil, to not disturb users who do use the +local mode directly. If you experience delays when running Magit +commands, then you should consider using one of the predicates +provided by Magit - especially if you also use Tramp. + +Users who do turn on `auto-revert-mode' in buffers in which Magit +doesn't do that for them, should likely not use any filter. +Users who turn on `global-auto-revert-mode', do not have to worry +about this option, because it is disregarded if the global mode +is enabled." + :package-version '(magit . "2.4.2") + :group 'auto-revert + :group 'magit-auto-revert + :type '(radio (const :tag "no filter" nil) + (function-item magit-auto-revert-buffer-p) + (function-item magit-auto-revert-repository-buffer-p) + function)) + (defcustom magit-auto-revert-tracked-only t "Whether `magit-auto-revert-mode' only reverts tracked files." :package-version '(magit . "2.4.0") - :group 'magit + :group 'magit-auto-revert :type 'boolean :set (lambda (var val) (set var val) @@ -42,7 +73,7 @@ (magit-auto-revert-mode -1) (magit-auto-revert-mode)))) -(defcustom magit-auto-revert-immediately (not file-notify--library) +(defcustom magit-auto-revert-immediately t "Whether Magit reverts buffers immediately. If this is non-nil and either `global-auto-revert-mode' or @@ -52,13 +83,14 @@ after running git for side-effects. If `auto-revert-use-notify' is non-nil (and file notifications are actually supported), then `magit-auto-revert-immediately' -should be nil, because the reverts happen immediately anyway. +does not have to be non-nil, because the reverts happen +immediately anyway. If `magit-auto-revert-immediately' and `auto-revert-use-notify' are both nil, then reverts happen after `auto-revert-interval' seconds of user inactivity. That is not desirable." :package-version '(magit . "2.4.0") - :group 'magit + :group 'magit-auto-revert :type 'boolean) (defun magit-turn-on-auto-revert-mode-if-desired (&optional file) @@ -83,6 +115,7 @@ seconds of user inactivity. That is not desirable." magit-turn-on-auto-revert-mode-if-desired :package-version '(magit . "2.4.0") :group 'magit + :group 'magit-auto-revert ;; When `global-auto-revert-mode' is enabled, then this mode is ;; redundant. When `magit-revert-buffers' is nil, then the user has ;; opted out of the automatic reverts while the old implementation @@ -132,13 +165,64 @@ notices that. Unlike `global-auto-revert-mode', this mode never reverts any buffers that are not visiting files. +The behavior of this mode can be customized using the options +in the `autorevert' and `magit-autorevert' groups. + This function calls the hook `magit-auto-revert-mode-hook'.") (defun magit-auto-revert-buffers () (when (and magit-auto-revert-immediately (or global-auto-revert-mode (and magit-auto-revert-mode auto-revert-buffer-list))) - (auto-revert-buffers))) + (let ((auto-revert-buffer-list-filter + (or auto-revert-buffer-list-filter + 'magit-auto-revert-repository-buffer-p))) + (auto-revert-buffers)))) + +(defvar magit-auto-revert-toplevel nil) + +(when (< emacs-major-version 25) + (defvar auto-revert-buffers-counter 1 + "Incremented each time `auto-revert-buffers' is called")) + +(defun magit-auto-revert-buffer-p (buffer) + "Return t if BUFFER visits a file inside the current repository. +The current repository is the one in which `default-directory' is +located. If there is no current repository, then return t for +any BUFFER." + (magit-auto-revert-repository-buffer-p buffer t)) + +(defun magit-auto-revert-repository-buffer-p (buffer &optional fallback) + "Return t if BUFFER visits a file inside the current repository. +The current repository is the one in which `default-directory' is +located. If there is no current repository, then return FALLBACK +\(which defaults to nil) for any BUFFER." + ;; Call `magit-toplevel' just once per cycle. + (unless (and magit-auto-revert-toplevel + (= (cdr magit-auto-revert-toplevel) + auto-revert-buffers-counter)) + (setq magit-auto-revert-toplevel + (cons (or (magit-toplevel) 'no-repo) + auto-revert-buffers-counter))) + (let ((top (car magit-auto-revert-toplevel))) + (if (eq top 'no-repo) + fallback + (let ((dir (with-current-buffer buffer default-directory))) + (and (equal (file-remote-p dir) + (file-remote-p top)) + ;; ^ `tramp-handle-file-in-directory-p' lacks this optimization. + (file-in-directory-p dir top)))))) + +(defun auto-revert-buffers--buffer-list-filter () + (when (< emacs-major-version 25) + (cl-incf auto-revert-buffers-counter)) + (when auto-revert-buffer-list-filter + (setq auto-revert-buffer-list + (--filter auto-revert-buffer-list-filter + auto-revert-buffer-list)))) + +(advice-add 'auto-revert-buffers :before + 'auto-revert-buffers--buffer-list-filter) (custom-add-to-group 'magit 'auto-revert-check-vc-info 'custom-variable) diff --git a/elpa/magit-20160117.2129/magit-bisect.el b/elpa/magit-20160211.2105/magit-bisect.el similarity index 97% rename from elpa/magit-20160117.2129/magit-bisect.el rename to elpa/magit-20160211.2105/magit-bisect.el index 67c63da8..3956a973 100644 --- a/elpa/magit-20160117.2129/magit-bisect.el +++ b/elpa/magit-20160211.2105/magit-bisect.el @@ -126,11 +126,8 @@ bisect run'." (unless (or no-assert (magit-bisect-in-progress-p)) (user-error "Not bisecting")) (magit-with-toplevel - (let ((file (magit-git-dir "BISECT_CMD_OUTPUT"))) - (ignore-errors (delete-file file)) - (magit-run-git-with-logfile file "bisect" subcommand args)) - (magit-process-wait) - (magit-refresh))) + (magit-run-git-with-logfile + (magit-git-dir "BISECT_CMD_OUTPUT") "bisect" subcommand args))) (defun magit-bisect-in-progress-p () (file-exists-p (magit-git-dir "BISECT_LOG"))) diff --git a/elpa/magit-20160117.2129/magit-blame.el b/elpa/magit-20160211.2105/magit-blame.el similarity index 99% rename from elpa/magit-20160117.2129/magit-blame.el rename to elpa/magit-20160211.2105/magit-blame.el index 064b7cd7..4af7bb71 100644 --- a/elpa/magit-20160117.2129/magit-blame.el +++ b/elpa/magit-20160211.2105/magit-blame.el @@ -153,7 +153,8 @@ and then turned on again when turning off the latter." (defvar-local magit-blame-separator nil) (define-minor-mode magit-blame-mode - "Display blame information inline." + "Display blame information inline. +\n\\{magit-blame-mode-map}" :lighter magit-blame-mode-lighter (cond (magit-blame-mode (when (called-interactively-p 'any) diff --git a/elpa/magit-20160117.2129/magit-commit.el b/elpa/magit-20160211.2105/magit-commit.el similarity index 100% rename from elpa/magit-20160117.2129/magit-commit.el rename to elpa/magit-20160211.2105/magit-commit.el diff --git a/elpa/magit-20160117.2129/magit-core.el b/elpa/magit-20160211.2105/magit-core.el similarity index 100% rename from elpa/magit-20160117.2129/magit-core.el rename to elpa/magit-20160211.2105/magit-core.el diff --git a/elpa/magit-20160117.2129/magit-diff.el b/elpa/magit-20160211.2105/magit-diff.el similarity index 99% rename from elpa/magit-20160117.2129/magit-diff.el rename to elpa/magit-20160211.2105/magit-diff.el index 197a18f1..812ce635 100644 --- a/elpa/magit-20160117.2129/magit-diff.el +++ b/elpa/magit-20160211.2105/magit-diff.el @@ -1431,9 +1431,9 @@ section or a child thereof." (insert (propertize (if new (concat "new module " module) (concat "modified " module)) - 'face 'magit-diff-file-heading) - (cond (dirty " (modified content)") - (deleted " (deleted submodule)"))) + 'face 'magit-diff-file-heading)) + (cond (dirty (insert " (modified content)")) + (deleted (insert " (deleted submodule)"))) (insert ?\n))))) (defun magit-diff-wash-hunk () diff --git a/elpa/magit-20160117.2129/magit-ediff.el b/elpa/magit-20160211.2105/magit-ediff.el similarity index 100% rename from elpa/magit-20160117.2129/magit-ediff.el rename to elpa/magit-20160211.2105/magit-ediff.el diff --git a/elpa/magit-20160117.2129/magit-extras.el b/elpa/magit-20160211.2105/magit-extras.el similarity index 100% rename from elpa/magit-20160117.2129/magit-extras.el rename to elpa/magit-20160211.2105/magit-extras.el diff --git a/elpa/magit-20160117.2129/magit-git.el b/elpa/magit-20160211.2105/magit-git.el similarity index 90% rename from elpa/magit-20160117.2129/magit-git.el rename to elpa/magit-20160211.2105/magit-git.el index 79093571..61240785 100644 --- a/elpa/magit-20160117.2129/magit-git.el +++ b/elpa/magit-20160211.2105/magit-git.el @@ -62,20 +62,24 @@ ;; than using "bin/git.exe" directly. (or (and (eq system-type 'windows-nt) (--when-let (executable-find "git.exe") - (or (with-temp-buffer - (when (save-excursion - (= (call-process - it nil '(t t) nil "-c" - "alias.exe=!which git | cygpath -wf -" "exe") 0)) - (prog1 (delete-and-extract-region 1 (line-end-position)) - (save-excursion - (insert "PATH=") - (call-process - it nil '(t t) nil "-c" - "alias.path=!cygpath -wp \"$PATH\"" "path")) - (setq magit-git-environment - (list (buffer-substring-no-properties - (point) (line-end-position))))))) + (or (ignore-errors + ;; Git for Windows 2.x provides cygpath so we can + ;; ask it for native paths. Using an upper case + ;; alias makes this fail on 1.x (which is good, + ;; because we would not want to end up using some + ;; other cygpath). + (prog1 (car + (process-lines + it "-c" + "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" + "X" "git")) + (setq magit-git-environment + (list (concat "PATH=" + (car (process-lines + it "-c" + "alias.P=!cygpath -wp \"$PATH\"" + "P"))))))) + ;; For 1.x, we search for bin/ next to cmd/. (let ((alt (directory-file-name (file-name-directory it)))) (if (and (equal (file-name-nondirectory alt) "cmd") (setq alt (expand-file-name @@ -164,6 +168,20 @@ to return a propertized label that represents the ref." (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. + +This controls whether commands that read a branch from the user +and then set it as the upstream branch, offer a local or a remote +branch as default completion candidate, when they have the choice. + +This affects all commands that use `magit-read-upstream-branch' +or `magit-read-starting-point', which includes all commands that +change the upstream and many which create new branches." + :package-version '(magit . "2.4.2") + :group 'magit-commands + :type 'boolean) + ;;; Git (defun magit-process-git-arguments (args) @@ -299,6 +317,12 @@ call function WASHER with no argument." (= (point) (1+ beg))) (magit-cancel-section))))) +(defun magit-git-version (&optional raw) + (--when-let (let (magit-git-global-arguments) + (ignore-errors (substring (magit-git-string "version") 12))) + (if raw it (and (string-match "^\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" it) + (match-string 1 it))))) + ;;; Files (defun magit--safe-default-directory (&optional file) @@ -538,7 +562,12 @@ range. Otherwise, it can be any revision or range accepted by (file-name-as-directory (match-string 1 it))) (lwarn '(magit) :error "Failed to parse Cygwin mount: %S" it)) - (ignore-errors (process-lines "mount"))) + ;; If --exec-path is not a native Windows path, + ;; then we probably have a cygwin git. + (and (not (string-match-p + "\\`[a-zA-Z]:" + (car (process-lines "git" "--exec-path")))) + (ignore-errors (process-lines "mount")))) #'> :key (-lambda ((cyg . _win)) (length cyg)))) "Alist of (CYGWIN . WIN32) directory names. Sorted from longest to shortest CYGWIN name." @@ -968,19 +997,26 @@ where COMMITS is the number of commits in TAG but not in REV." (list (match-string 1 it))) (magit-git-items "ls-files" "-z" "--stage"))) -(defun magit-branch-p (string) - (or (car (member string (magit-list-branches))) - (car (member string (magit-list-branch-names))))) +(defun magit-ref-p (rev) + (or (car (member rev (magit-list-refs))) + (car (member rev (magit-list-refnames))))) + +(defun magit-branch-p (rev) + (or (car (member rev (magit-list-branches))) + (car (member rev (magit-list-branch-names))))) -(defun magit-local-branch-p (string) - (or (car (member string (magit-list-local-branches))) - (car (member string (magit-list-local-branch-names))))) +(defun magit-local-branch-p (rev) + (or (car (member rev (magit-list-local-branches))) + (car (member rev (magit-list-local-branch-names))))) (defun magit-branch-set-face (branch) (propertize branch 'face (if (magit-local-branch-p branch) 'magit-branch-local 'magit-branch-remote))) +(defun magit-tag-p (rev) + (car (member rev (magit-list-tags)))) + (defun magit-remote-p (string) (car (member string (magit-list-remotes)))) @@ -996,8 +1032,11 @@ Return a list of two integers: (A>B B>A)." (defun magit-abbrev-length () (string-to-number (or (magit-get "core.abbrev") "7"))) -(defun magit-abbrev-arg () - (format "--abbrev=%d" (magit-abbrev-length))) +(defun magit-abbrev-arg (&optional arg) + (format "--%s=%d" (or arg "abbrev") (magit-abbrev-length))) + +(defun magit-rev-abbrev (rev) + (magit-rev-parse (magit-abbrev-arg "short") rev)) (defun magit-commit-children (commit &optional args) (-map #'car @@ -1024,17 +1063,6 @@ Return a list of two integers: (A>B B>A)." (format "%s diff-tree -u %s | %s patch-id" exec rev exec))) (car (split-string (buffer-string))))) -(defun magit-reflog-enable (ref &optional stashish) - (let ((oldrev (magit-rev-verify ref)) - (logfile (magit-git-dir (concat "logs/" ref)))) - (unless (file-exists-p logfile) - (when oldrev - (magit-git-success "update-ref" "-d" ref oldrev)) - (make-directory (file-name-directory logfile) t) - (with-temp-file logfile) - (when (and oldrev (not stashish)) - (magit-git-success "update-ref" "-m" "enable reflog" ref oldrev ""))))) - (defun magit-rev-format (format &optional rev args) (let ((str (magit-git-string "show" "--no-patch" (concat "--format=" format) args @@ -1133,6 +1161,26 @@ Return a list of two integers: (A>B B>A)." (defun magit-update-files (files) (magit-git-success "update-index" "--add" "--remove" "--" files)) +(defun magit-update-ref (ref message rev &optional stashish) + (or (if (not (version< (magit-git-version) "2.6.0")) + (magit-git-success "update-ref" "--create-reflog" + "-m" message ref rev + (or (magit-rev-verify ref) "")) + ;; `--create-reflog' didn't exist before v2.6.0 + (let ((oldrev (magit-rev-verify ref)) + (logfile (magit-git-dir (concat "logs/" ref)))) + (unless (file-exists-p logfile) + (when oldrev + (magit-git-success "update-ref" "-d" ref oldrev)) + (make-directory (file-name-directory logfile) t) + (with-temp-file logfile) + (when (and oldrev (not stashish)) + (magit-git-success "update-ref" "-m" "enable reflog" + ref oldrev "")))) + (magit-git-success "update-ref" "-m" message ref rev + (or (magit-rev-verify ref) ""))) + (error "Cannot update %s with %s" ref rev))) + (defconst magit-range-re (concat "\\`\\([^ \t]*[^.]\\)?" ; revA "\\(\\.\\.\\.?\\)" ; range marker @@ -1194,7 +1242,7 @@ Return a list of two integers: (A>B B>A)." (magit-list-remotes)))) (magit-list-remote-branch-names remote t)) nil require-match nil 'magit-revision-history default))) - (if (string-match "\\`\\([^/]+\\)/\\(.+\\)" choice) + (if (or remote (string-match "\\`\\([^/]+\\)/\\(.+\\)" choice)) choice (user-error "`%s' doesn't have the form REMOTE/BRANCH" choice)))) @@ -1250,18 +1298,36 @@ Return a list of two integers: (A>B B>A)." (cl-defun magit-read-upstream-branch (&optional (branch (magit-get-current-branch)) prompt) - (magit-completing-read (or prompt (format "Change upstream of %s to" branch)) - (nconc (--map (concat it "/" branch) - (magit-list-remotes)) - (delete branch (magit-list-branch-names))) - nil nil nil 'magit-revision-history - (or (let ((atpoint (magit-branch-at-point))) - (and (not (equal atpoint branch)) atpoint)) - (magit-branch-p "origin/master") - (and (not (equal branch "master")) - (magit-branch-p "master")) - (let ((previous (magit-get-previous-branch))) - (and (not (equal previous branch)) previous))))) + (magit-completing-read + (or prompt (format "Change upstream of %s to" branch)) + (nconc (--map (concat it "/" branch) + (magit-list-remotes)) + (delete branch (magit-list-branch-names))) + nil nil nil 'magit-revision-history + (or (let ((r (magit-remote-branch-at-point)) + (l (magit-branch-at-point))) + (when (and l (equal l branch)) + (setq l nil)) + (if magit-prefer-remote-upstream (or r l) (or l r))) + (let ((r (magit-branch-p "origin/master")) + (l (and (not (equal branch "master")) + (magit-branch-p "master")))) + (if magit-prefer-remote-upstream (or r l) (or l r))) + (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 + (or (let ((r (magit-remote-branch-at-point)) + (l (magit-local-branch-at-point))) + (if magit-prefer-remote-upstream (or r l) (or l r))) + (magit-commit-at-point) + (magit-stash-at-point) + (magit-get-current-branch))) + (user-error "Nothing selected"))) (defun magit-read-tag (prompt &optional require-match) (magit-completing-read prompt (magit-list-tags) nil diff --git a/elpa/magit-20160117.2129/magit-log.el b/elpa/magit-20160211.2105/magit-log.el similarity index 95% rename from elpa/magit-20160117.2129/magit-log.el rename to elpa/magit-20160211.2105/magit-log.el index db9071c3..72f4d4a6 100644 --- a/elpa/magit-20160117.2129/magit-log.el +++ b/elpa/magit-20160211.2105/magit-log.el @@ -294,6 +294,7 @@ the upstream isn't ahead of the current branch) show." :options ((?n "Limit number of commits" "-n") (?f "Limit to files" "-- " magit-read-files) (?a "Limit to author" "--author=") + (?o "Order commits by" "++order=" magit-log-select-order) (?g "Search messages" "--grep=") (?G "Search changes" "-G") (?S "Search occurences" "-S") @@ -324,6 +325,7 @@ the upstream isn't ahead of the current branch) show." :options ((?n "Limit number of commits" "-n") (?f "Limit to files" "-- " magit-read-files) (?a "Limit to author" "--author=") + (?o "Order commits by" "++order=" magit-log-select-order) (?g "Search messages" "--grep=") (?G "Search changes" "-G") (?S "Search occurences" "-S") @@ -345,7 +347,8 @@ the upstream isn't ahead of the current branch) show." :switches ((?g "Show graph" "--graph") (?c "Show graph in color" "--color") (?d "Show refnames" "--decorate")) - :options ((?n "Limit number of commits" "-n")) + :options ((?n "Limit number of commits" "-n") + (?o "Order commits by" "++order=" magit-log-select-order)) :actions ((?g "Refresh" magit-log-refresh) (?t "Toggle margin" magit-toggle-margin) (?s "Set defaults" magit-log-set-default-arguments) nil @@ -356,7 +359,7 @@ the upstream isn't ahead of the current branch) show." (magit-define-popup-keys-deferred 'magit-log-mode-refresh-popup) (magit-define-popup-keys-deferred 'magit-log-refresh-popup) -(defun magit-read-file-trace (&rest ignored) +(defun magit-read-file-trace (&rest _ignored) (let ((file (magit-read-file-from-rev "HEAD" "File")) (trace (magit-read-string "Trace"))) (if (string-match @@ -364,6 +367,12 @@ the upstream isn't ahead of the current branch) show." (concat trace (or (match-string 2 trace) ":") file) (user-error "Trace is invalid, see man git-log")))) +(defun magit-log-select-order (&rest _ignored) + (magit-read-char-case "Order commits by " t + (?t "[t]opography" "topo") + (?a "[a]uthor date" "author-date") + (?c "[c]ommitter date" "date"))) + (defun magit-log-arguments (&optional refresh) (cond ((memq magit-current-popup '(magit-log-popup magit-log-refresh-popup)) @@ -729,13 +738,17 @@ Do not add this to a hook variable." (progn (setq args (remove "--show-signature" args)) "%G?") "") (if (member "++header" args) - (if (member "--graph" (setq args (delete "++header" args))) + (if (member "--graph" (setq args (remove "++header" args))) (concat "\n" magit-log-revision-headers-format "\n") (concat "\n" magit-log-revision-headers-format "\n")) "")) - (if (member "--decorate" args) - (cons "--decorate=full" (remove "--decorate" args)) - args) + (progn + (--when-let (--first (string-match "^\\+\\+order=\\(.+\\)$" it) args) + (setq args (cons (format "--%s-order" (match-string 1 it)) + (remove it args)))) + (if (member "--decorate" args) + (cons "--decorate=full" (remove "--decorate" args)) + args)) "--use-mailmap" "--no-prefix" revs "--" files)) (defvar magit-commit-section-map @@ -1281,8 +1294,10 @@ Type \\[magit-reset] to reset HEAD to the commit at point. (defun magit-insert-unpulled-from-pushremote () "Insert commits that haven't been pulled from the push-remote yet." (--when-let (magit-get-push-branch) - (unless (equal (magit-rev-name it) - (magit-rev-name "@{upstream}")) + (unless (and (equal (magit-rev-name it) + (magit-rev-name "@{upstream}")) + (memq 'magit-insert-unpulled-from-upstream + magit-status-sections-hook)) (magit-insert-section (unpulled (concat ".." it)) (magit-insert-heading (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) @@ -1304,7 +1319,7 @@ Type \\[magit-reset] to reset HEAD to the commit at point. (when (magit-git-success "rev-parse" "@{upstream}") (magit-insert-section (unpushed "@{upstream}..") (magit-insert-heading - (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) + (format (propertize "Unmerged into %s:" 'face 'magit-section-heading) (magit-get-upstream-branch))) (magit-insert-log "@{upstream}.." magit-log-section-arguments) (magit-section-cache-visibility)))) @@ -1316,8 +1331,10 @@ Type \\[magit-reset] to reset HEAD to the commit at point. (defun magit-insert-unpushed-to-pushremote () "Insert commits that haven't been pushed to the push-remote yet." (--when-let (magit-get-push-branch) - (unless (equal (magit-rev-name it) - (magit-rev-name "@{upstream}")) + (unless (and (equal (magit-rev-name it) + (magit-rev-name "@{upstream}")) + (memq 'magit-insert-unpushed-to-upstream + magit-status-sections-hook)) (magit-insert-section (unpushed (concat it "..")) (magit-insert-heading (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) @@ -1376,58 +1393,6 @@ all others with \"-\"." (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry) "cherry" "-v" (magit-abbrev-arg) "@{upstream}")))) -;;;; Submodule Sections - -(defun magit-insert-submodule-commits (section range) - "For internal use, don't add to a hook." - (if (magit-section-hidden section) - (setf (magit-section-washer section) - (apply-partially #'magit-insert-submodule-commits section range)) - (magit-git-wash (apply-partially 'magit-log-wash-log 'module) - "log" "--oneline" range) - (when (> (point) (magit-section-content section)) - (delete-char -1)))) - -(defun magit-insert-unpulled-module-commits () - "Insert sections for all submodules with unpulled commits. -These sections can be expanded to show the respective commits." - (-when-let (modules (magit-get-submodules)) - (magit-insert-section section (unpulled-modules) - (magit-insert-heading "Unpulled modules:") - (magit-with-toplevel - (dolist (module modules) - (let ((default-directory - (expand-file-name (file-name-as-directory module)))) - (-when-let (tracked (magit-get-upstream-ref)) - (magit-insert-section sec (file module t) - (magit-insert-heading - (concat (propertize module 'face 'magit-diff-file-heading) ":")) - (magit-insert-submodule-commits - section (concat "HEAD.." tracked))))))) - (if (> (point) (magit-section-content section)) - (insert ?\n) - (magit-cancel-section))))) - -(defun magit-insert-unpushed-module-commits () - "Insert sections for all submodules with unpushed commits. -These sections can be expanded to show the respective commits." - (-when-let (modules (magit-get-submodules)) - (magit-insert-section section (unpushed-modules) - (magit-insert-heading "Unpushed modules:") - (magit-with-toplevel - (dolist (module modules) - (let ((default-directory - (expand-file-name (file-name-as-directory module)))) - (-when-let (tracked (magit-get-upstream-ref)) - (magit-insert-section sec (file module t) - (magit-insert-heading - (concat (propertize module 'face 'magit-diff-file-heading) ":")) - (magit-insert-submodule-commits - section (concat tracked "..HEAD"))))))) - (if (> (point) (magit-section-content section)) - (insert ?\n) - (magit-cancel-section))))) - ;;; Buffer Margins (defvar-local magit-set-buffer-margin-refresh nil) @@ -1447,9 +1412,11 @@ These sections can be expanded to show the respective commits." Supported modes are `magit-log-mode' and `magit-reflog-mode', and the respective options are `magit-log-show-margin' and `magit-reflog-show-margin'." - (pcase major-mode - (`magit-log-mode (magit-set-buffer-margin magit-log-show-margin)) - (`magit-reflog-mode (magit-set-buffer-margin magit-reflog-show-margin)))) + (if (local-variable-p 'magit-show-margin) + (magit-set-buffer-margin magit-show-margin) + (pcase major-mode + (`magit-log-mode (magit-set-buffer-margin magit-log-show-margin)) + (`magit-reflog-mode (magit-set-buffer-margin magit-reflog-show-margin))))) (defun magit-set-buffer-margin (enable) (let ((width (cond ((not enable) nil) diff --git a/elpa/magit-20160117.2129/magit-mode.el b/elpa/magit-20160211.2105/magit-mode.el similarity index 98% rename from elpa/magit-20160117.2129/magit-mode.el rename to elpa/magit-20160211.2105/magit-mode.el index d5c32c6c..fbae8342 100644 --- a/elpa/magit-20160117.2129/magit-mode.el +++ b/elpa/magit-20160211.2105/magit-mode.el @@ -578,7 +578,7 @@ thinking a buffer belongs to a repo that it doesn't.") (with-current-buffer buffer (setq list-buffers-directory default-directory)) (let ((uniquify-buffer-name-style - (if (eq uniquify-buffer-name-style 'forward) + (if (memq uniquify-buffer-name-style '(nil forward)) 'post-forward-angle-brackets uniquify-buffer-name-style))) (uniquify-rationalize-file-buffer-names @@ -685,7 +685,9 @@ window." "Refresh some buffers belonging to the current repository. Refresh the current buffer if its major mode derives from -`magit-mode', and refresh the corresponding status buffer." +`magit-mode', and refresh the corresponding status buffer. + +Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (interactive) (unless inhibit-magit-refresh (magit-run-hook-with-benchmark 'magit-pre-refresh-hook) @@ -702,14 +704,17 @@ Refresh the current buffer if its major mode derives from (defun magit-refresh-all () "Refresh all buffers belonging to the current repository. -Refresh all Magit buffers belonging to the current repository. +Refresh all Magit buffers belonging to the current repository, +and revert buffers that visit files located inside the current +repository. -Also always revert all unmodified buffers that visit files being -tracked in the current repository." +Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (interactive) + (magit-run-hook-with-benchmark 'magit-pre-refresh-hook) (dolist (buffer (magit-mode-get-buffers)) (with-current-buffer buffer (magit-refresh-buffer))) - (magit-auto-revert-buffers)) + (magit-auto-revert-buffers) + (magit-run-hook-with-benchmark 'magit-post-refresh-hook)) (defvar-local magit-refresh-start-time nil) diff --git a/elpa/magit-20160117.2129/magit-pkg.el b/elpa/magit-20160211.2105/magit-pkg.el similarity index 55% rename from elpa/magit-20160117.2129/magit-pkg.el rename to elpa/magit-20160211.2105/magit-pkg.el index 091e9cf6..d9b98e1a 100644 --- a/elpa/magit-20160117.2129/magit-pkg.el +++ b/elpa/magit-20160211.2105/magit-pkg.el @@ -1,10 +1,10 @@ -(define-package "magit" "20160117.2129" "A Git porcelain inside Emacs" +(define-package "magit" "20160211.2105" "A Git porcelain inside Emacs" '((emacs "24.4") (async "20150909.2257") (dash "20151021.113") - (with-editor "20160117.1513") - (git-commit "20160117.1513") - (magit-popup "20160117.1513")) + (with-editor "20160128.1201") + (git-commit "20160119.1409") + (magit-popup "20160119.1409")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc")) ;; Local Variables: diff --git a/elpa/magit-20160117.2129/magit-process.el b/elpa/magit-20160211.2105/magit-process.el similarity index 95% rename from elpa/magit-20160117.2129/magit-process.el rename to elpa/magit-20160211.2105/magit-process.el index 2130df20..563e77b2 100644 --- a/elpa/magit-20160117.2129/magit-process.el +++ b/elpa/magit-20160211.2105/magit-process.el @@ -315,41 +315,39 @@ Identical to `process-file' but temporarily enable Cygwin's "noglob"))) '("CYGWIN" "MSYS"))))) -(defun magit-run-git-with-input (input &rest args) +(defvar magit-this-process nil) + +(defun magit-run-git-with-input (&rest args) "Call Git in a separate process. ARGS is flattened and then used as arguments to Git. -The first argument, INPUT, should be a buffer or the name of -an existing buffer. The content of that buffer is used as the -process' standard input. It may also be nil in which case the -current buffer is used. +The current buffer's content is used as the process' standard +input. Option `magit-git-executable' specifies the Git executable and option `magit-git-global-arguments' specifies constant arguments. The remaining arguments ARGS specify arguments to Git, they are -flattened before use. - -After Git returns, the current buffer (if it is a Magit buffer) -as well as the current repository's status buffer are refreshed. -When INPUT is nil then do not refresh any buffers. - -This function actually starts a asynchronous process, but it then -waits for that process to return." +flattened before use." (declare (indent 1)) - (magit-start-git (or input (current-buffer)) args) - (magit-process-wait) - (when input (magit-refresh))) - -(defvar magit-this-process nil) + (if (file-remote-p default-directory) + ;; We lack `process-file-region', so fall back to asynch + + ;; waiting in remote case. + (progn + (magit-start-git (current-buffer) args) + (while (and magit-this-process + (eq (process-status magit-this-process) 'run)) + (sleep-for 0.005))) + (let ((process-environment (append (magit-cygwin-env-vars) + process-environment))) + (apply #'call-process-region (point-min) (point-max) + magit-git-executable nil nil nil + (magit-process-git-arguments args))))) (defun magit-run-git-with-logfile (file &rest args) "Call Git in a separate process and log its output to FILE. -See `magit-run-git' for more information. This function might have a short halflive." - (magit-start-git nil args) - (process-put magit-this-process 'logfile file) - (set-process-filter magit-this-process 'magit-process-logfile-filter) - (magit-process-wait) + (apply #'magit-process-file magit-git-executable nil `(:file ,file) nil + (magit-process-git-arguments args)) (magit-refresh)) ;;; Asynchronous Processes @@ -597,17 +595,6 @@ Magit status buffer." (insert (substring string (1+ ret-pos))))) (set-marker (process-mark proc) (point))))) -(defun magit-process-logfile-filter (process string) - "Special filter used by `magit-run-git-with-logfile'." - (magit-process-filter process string) - (let ((file (process-get process 'logfile))) - (with-temp-file file - (when (file-exists-p file) - (insert-file-contents file) - (goto-char (point-max))) - (insert string) - (write-region (point-min) (point-max) file)))) - (defmacro magit-process-kill-on-abort (proc &rest body) (declare (indent 1) (debug (form body))) (let ((map (cl-gensym))) @@ -715,11 +702,6 @@ as argument." (add-hook 'magit-credential-hook #'magit-maybe-start-credential-cache-daemon) -(defun magit-process-wait () - (while (and magit-this-process - (eq (process-status magit-this-process) 'run)) - (sleep-for 0.005))) - (defun tramp-sh-handle-start-file-process--magit-tramp-process-environment (fn name buffer program &rest args) (if magit-tramp-process-environment diff --git a/elpa/magit-20160117.2129/magit-remote.el b/elpa/magit-20160211.2105/magit-remote.el similarity index 93% rename from elpa/magit-20160117.2129/magit-remote.el rename to elpa/magit-20160211.2105/magit-remote.el index ea4ecacf..4ae61eb9 100644 --- a/elpa/magit-20160117.2129/magit-remote.el +++ b/elpa/magit-20160211.2105/magit-remote.el @@ -33,6 +33,12 @@ ;;; Clone +(defcustom magit-clone-set-remote-head nil + "Whether cloning creates the symbolic-ref `/HEAD'." + :package-version '(magit . "2.4.2") + :group 'magit-commands + :type 'boolean) + (defcustom magit-clone-set-remote.pushDefault 'ask "Whether to set the value of `remote.pushDefault' after cloning. @@ -60,11 +66,13 @@ Then show the status buffer for the new repository." ;; Stop cygwin git making a "c:" directory. (magit-convert-git-filename directory)) 0) - (when (or (eq magit-clone-set-remote.pushDefault t) - (and magit-clone-set-remote.pushDefault - (y-or-n-p "Set `remote.pushDefault' to \"origin\"? "))) - (let ((default-directory directory)) - (magit-call-git "config" "remote.pushDefault" "origin"))) + (let ((default-directory directory)) + (when (or (eq magit-clone-set-remote.pushDefault t) + (and magit-clone-set-remote.pushDefault + (y-or-n-p "Set `remote.pushDefault' to \"origin\"? "))) + (magit-call-git "config" "remote.pushDefault" "origin")) + (unless magit-clone-set-remote-head + (magit-remote-unset-head "origin"))) (message "Cloning %s...done" repository) (magit-status-internal directory))) @@ -140,6 +148,28 @@ the variable isn't already set." (interactive (list (magit-read-remote "Delete remote"))) (magit-run-git "remote" "rm" remote)) +;;;###autoload +(defun magit-remote-set-head (remote &optional branch) + "Set the local representation of REMOTE's default branch. +Query REMOTE and set the symbolic-ref refs/remotes//HEAD +accordingly. With a prefix argument query for the branch to be +used, which allows you to select an incorrect value if you fancy +doing that." + (interactive + (let ((remote (magit-read-remote "Set HEAD for remote"))) + (list remote + (and current-prefix-arg + (magit-read-remote-branch (format "Set %s/HEAD to" remote) + remote nil nil t))))) + (magit-run-git "remote" "set-head" remote (or branch "--auto"))) + +;;;###autoload +(defun magit-remote-unset-head (remote) + "Unset the local representation of REMOTE's default branch. +Delete the symbolic-ref \"refs/remotes//HEAD\"." + (interactive (list (magit-read-remote "Unset HEAD for remote"))) + (magit-run-git "remote" "set-head" remote "--delete")) + ;;; Fetch ;;;###autoload (autoload 'magit-fetch-popup "magit-remote" nil t) @@ -599,6 +629,8 @@ To add this command to the push popup add this to your init file: "Popup console for patch commands." 'magit-commands :man-page "git-format-patch" + :switches '("Switches for formatting patches" + (?l "Add cover letter" "--cover-letter")) :options '("Options for formatting patches" (?f "From" "--from=") (?t "To" "--to=") @@ -631,7 +663,16 @@ HEAD but not from the specified commit)." range (format "%s~..%s" range range)))) (magit-patch-arguments))) - (magit-run-git "format-patch" range args)) + (magit-call-git "format-patch" range args) + (when (member "--cover-letter" args) + (find-file + (expand-file-name + "0000-cover-letter.patch" + (let ((topdir (magit-toplevel))) + (or (--some (and (string-match "--output-directory=\\(.+\\)" it) + (expand-file-name (match-string 1 it) topdir)) + args) + topdir)))))) ;;;###autoload (defun magit-request-pull (url start end) diff --git a/elpa/magit-20160117.2129/magit-section.el b/elpa/magit-20160211.2105/magit-section.el similarity index 100% rename from elpa/magit-20160117.2129/magit-section.el rename to elpa/magit-20160211.2105/magit-section.el diff --git a/elpa/magit-20160117.2129/magit-sequence.el b/elpa/magit-20160211.2105/magit-sequence.el similarity index 100% rename from elpa/magit-20160117.2129/magit-sequence.el rename to elpa/magit-20160211.2105/magit-sequence.el diff --git a/elpa/magit-20160117.2129/magit-stash.el b/elpa/magit-20160211.2105/magit-stash.el similarity index 97% rename from elpa/magit-20160117.2129/magit-stash.el rename to elpa/magit-20160211.2105/magit-stash.el index de23833f..bc435e85 100644 --- a/elpa/magit-20160117.2129/magit-stash.el +++ b/elpa/magit-20160211.2105/magit-stash.el @@ -222,10 +222,10 @@ When the region is active offer to drop all contained stashes." (if (eq keep 'worktree) (with-temp-buffer (magit-git-insert "diff" "--cached") - (magit-run-git-with-input nil - "apply" "--reverse" "--cached" "--ignore-space-change" "-") - (magit-run-git-with-input nil - "apply" "--reverse" "--ignore-space-change" "-")) + (magit-run-git-with-input + "apply" "--reverse" "--cached" "--ignore-space-change" "-") + (magit-run-git-with-input + "apply" "--reverse" "--ignore-space-change" "-")) (unless (eq keep t) (if (eq keep 'index) (magit-call-git "checkout" "--" ".") @@ -240,10 +240,7 @@ When the region is active offer to drop all contained stashes." (t "local")))))) (defun magit-stash-store (message ref commit) - (magit-reflog-enable ref t) - (unless (magit-git-success "update-ref" "-m" message ref commit - (or (magit-rev-verify ref) "")) - (error "Cannot update %s with %s" ref commit))) + (magit-update-ref ref message commit t)) (defun magit-stash-create (message index worktree untracked) (unless (magit-rev-parse "--verify" "HEAD") diff --git a/elpa/magit-20160211.2105/magit-submodule.el b/elpa/magit-20160211.2105/magit-submodule.el new file mode 100644 index 00000000..e4c59b32 --- /dev/null +++ b/elpa/magit-20160211.2105/magit-submodule.el @@ -0,0 +1,174 @@ +;;; magit-submodule.el --- submodule support for Magit -*- lexical-binding: t -*- + +;; Copyright (C) 2011-2015 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. + +;;; Code: + +(require 'magit) + +;;; Commands + +;;;###autoload (autoload 'magit-submodule-popup "magit-submodule" nil t) +(magit-define-popup magit-submodule-popup + "Popup console for submodule commands." + 'magit-commands nil nil + :man-page "git-submodule" + :actions '((?a "Add" magit-submodule-add) + (?b "Setup" magit-submodule-setup) + (?i "Init" magit-submodule-init) + (?u "Update" magit-submodule-update) + (?s "Sync" magit-submodule-sync) + (?f "Fetch" magit-submodule-fetch) + (?d "Deinit" magit-submodule-deinit))) + +;;;###autoload +(defun magit-submodule-add (url &optional path) + "Add the repository at URL as a submodule. +Optional PATH is the path to the submodule relative to the root +of the superproject. If it is nil then the path is determined +based on URL." + (interactive + (magit-with-toplevel + (let ((path (read-file-name + "Add submodule: " nil nil nil + (magit-section-when [file untracked] + (directory-file-name (magit-section-value it)))))) + (when path + (setq path (file-name-as-directory (expand-file-name path))) + (when (member path (list "" default-directory)) + (setq path nil))) + (list (magit-read-string-ns + "Remote url" + (and path (magit-git-repo-p path t) + (let ((default-directory path)) + (magit-get "remote" (or (magit-get-remote) "origin") + "url")))) + (and path (directory-file-name (file-relative-name path))))))) + (magit-run-git "submodule" "add" url path)) + +;;;###autoload +(defun magit-submodule-setup () + "Clone and register missing submodules and checkout appropriate commits." + (interactive) + (magit-submodule-update t)) + +;;;###autoload +(defun magit-submodule-init () + "Register submodules listed in \".gitmodules\" into \".git/config\"." + (interactive) + (magit-with-toplevel + (magit-run-git-async "submodule" "init"))) + +;;;###autoload +(defun magit-submodule-update (&optional init) + "Clone missing submodules and checkout appropriate commits. +With a prefix argument also register submodules in \".git/config\"." + (interactive "P") + (magit-with-toplevel + (magit-run-git-async "submodule" "update" (and init "--init")))) + +;;;###autoload +(defun magit-submodule-sync () + "Update each submodule's remote URL according to \".gitmodules\"." + (interactive) + (magit-with-toplevel + (magit-run-git-async "submodule" "sync"))) + +;;;###autoload +(defun magit-submodule-fetch (&optional all) + "Fetch all submodules. +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" ""))))) + +;;;###autoload +(defun magit-submodule-deinit (path) + "Unregister the submodule at PATH." + (interactive + (list (magit-completing-read "Deinit module" (magit-get-submodules) + nil t nil nil (magit-section-when module)))) + (magit-with-toplevel + (magit-run-git-async "submodule" "deinit" path))) + +;;; Sections + +;;;###autoload +(defun magit-insert-submodule-commits (section range) + "For internal use, don't add to a hook." + (if (magit-section-hidden section) + (setf (magit-section-washer section) + (apply-partially #'magit-insert-submodule-commits section range)) + (magit-git-wash (apply-partially 'magit-log-wash-log 'module) + "log" "--oneline" range) + (when (> (point) (magit-section-content section)) + (delete-char -1)))) + +;;;###autoload +(defun magit-insert-unpulled-module-commits () + "Insert sections for all submodules with unpulled commits. +These sections can be expanded to show the respective commits." + (-when-let (modules (magit-get-submodules)) + (magit-insert-section section (unpulled-modules) + (magit-insert-heading "Unpulled modules:") + (magit-with-toplevel + (dolist (module modules) + (let ((default-directory + (expand-file-name (file-name-as-directory module)))) + (-when-let (tracked (magit-get-upstream-ref)) + (magit-insert-section sec (file module t) + (magit-insert-heading + (concat (propertize module 'face 'magit-diff-file-heading) ":")) + (magit-insert-submodule-commits + section (concat "HEAD.." tracked))))))) + (if (> (point) (magit-section-content section)) + (insert ?\n) + (magit-cancel-section))))) + +;;;###autoload +(defun magit-insert-unpushed-module-commits () + "Insert sections for all submodules with unpushed commits. +These sections can be expanded to show the respective commits." + (-when-let (modules (magit-get-submodules)) + (magit-insert-section section (unpushed-modules) + (magit-insert-heading "Unpushed modules:") + (magit-with-toplevel + (dolist (module modules) + (let ((default-directory + (expand-file-name (file-name-as-directory module)))) + (-when-let (tracked (magit-get-upstream-ref)) + (magit-insert-section sec (file module t) + (magit-insert-heading + (concat (propertize module 'face 'magit-diff-file-heading) ":")) + (magit-insert-submodule-commits + section (concat tracked "..HEAD"))))))) + (if (> (point) (magit-section-content section)) + (insert ?\n) + (magit-cancel-section))))) + +;;; magit-submodule.el ends soon +(provide 'magit-submodule) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: +;;; magit-submodule.el ends here diff --git a/elpa/magit-20160117.2129/magit-utils.el b/elpa/magit-20160211.2105/magit-utils.el similarity index 97% rename from elpa/magit-20160117.2129/magit-utils.el rename to elpa/magit-20160211.2105/magit-utils.el index 24333938..ca658306 100644 --- a/elpa/magit-20160117.2129/magit-utils.el +++ b/elpa/magit-20160211.2105/magit-utils.el @@ -49,11 +49,17 @@ ;;; Options (defcustom magit-completing-read-function 'magit-builtin-completing-read - "Function to be called when requesting input from the user." + "Function to be called when requesting input from the user. + +For Helm users, the simplest way to get Helm completion is to +turn on `helm-mode' and leave this option set to the default +value. However, if you prefer to not use `helm-mode' but still +want Magit to use Helm for completion, you can set this option to +`helm--completing-read-default'." :group 'magit :type '(radio (function-item magit-builtin-completing-read) (function-item magit-ido-completing-read) - (function-item helm-completing-read-with-cands-in-buffer) + (function-item helm--completing-read-default) (function :tag "Other"))) (defcustom magit-no-confirm nil diff --git a/elpa/magit-20160117.2129/magit-wip.el b/elpa/magit-20160211.2105/magit-wip.el similarity index 95% rename from elpa/magit-20160117.2129/magit-wip.el rename to elpa/magit-20160211.2105/magit-wip.el index e8963830..6e349978 100644 --- a/elpa/magit-20160117.2129/magit-wip.el +++ b/elpa/magit-20160211.2105/magit-wip.el @@ -204,17 +204,16 @@ commit message." (file-relative-name (car files) (magit-toplevel))))) msg))) - (magit-reflog-enable wipref) (unless (equal parent wipref) (setq start-msg (concat "restart autosaving " start-msg)) - (magit-call-git "update-ref" wipref "-m" start-msg - (magit-git-string "commit-tree" "-p" parent - "-m" start-msg - (concat parent "^{tree}"))) + (magit-update-ref wipref start-msg + (magit-git-string "commit-tree" "-p" parent + "-m" start-msg + (concat parent "^{tree}"))) (setq parent wipref)) - (magit-call-git "update-ref" wipref "-m" msg - (magit-git-string "commit-tree" tree - "-p" parent "-m" msg)))) + (magit-update-ref wipref msg + (magit-git-string "commit-tree" tree + "-p" parent "-m" msg)))) (defun magit-wip-get-ref () (let ((ref (or (magit-git-string "symbolic-ref" "HEAD") "HEAD"))) diff --git a/elpa/magit-20160117.2129/magit.el b/elpa/magit-20160211.2105/magit.el similarity index 96% rename from elpa/magit-20160117.2129/magit.el rename to elpa/magit-20160211.2105/magit.el index 5eba15eb..1480f7f5 100644 --- a/elpa/magit-20160117.2129/magit.el +++ b/elpa/magit-20160211.2105/magit.el @@ -16,7 +16,7 @@ ;; Rémi Vanicat ;; Yann Hodique -;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113") (with-editor "20160117.1513") (git-commit "20160117.1513") (magit-popup "20160117.1513")) +;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113") (with-editor "20160128.1201") (git-commit "20160119.1409") (magit-popup "20160119.1409")) ;; Keywords: git tools vc ;; Homepage: https://github.com/magit/magit @@ -1349,21 +1349,10 @@ changes. (magit-call-git "branch" (concat "--set-upstream-to=" it) branch)) (magit-refresh))) -(defun magit-branch-read-starting-point (prompt) - (or (magit-completing-read (concat prompt " starting at") - (cons "HEAD" (magit-list-refnames)) - nil nil nil 'magit-revision-history - (or (magit-remote-branch-at-point) - (magit-local-branch-at-point) - (magit-commit-at-point) - (magit-stash-at-point) - (magit-get-current-branch))) - (user-error "Nothing selected"))) - (defun magit-branch-read-args (prompt) (let ((args (magit-branch-arguments)) start branch) (cond (magit-branch-read-upstream-first - (setq start (magit-branch-read-starting-point prompt)) + (setq start (magit-read-starting-point prompt)) (setq branch (magit-read-string-ns "Branch name" (and (member start (magit-list-remote-branch-names)) @@ -1372,7 +1361,7 @@ changes. "/"))))) (t (setq branch (magit-read-string-ns "Branch name")) - (setq start (magit-branch-read-starting-point prompt)))) + (setq start (magit-read-starting-point prompt)))) (list branch start args))) ;;;###autoload @@ -1412,18 +1401,19 @@ of the new branch, instead of the starting-point itself." (magit-run-git "checkout" "-b" branch))) ;;;###autoload -(defun magit-branch-reset (branch to &optional args) +(defun magit-branch-reset (branch to &optional args set-upstream) "Reset a branch to the tip of another branch or any other commit. -When resetting to another branch, then also set that branch as -the upstream of the branch being reset. - When the branch being reset is the current branch, then do a hard reset. If there are any uncommitted changes, then the user has to confirming the reset because those changes would be lost. This is useful when you have started work on a feature branch but -realize it's all crap and want to start over." +realize it's all crap and want to start over. + +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)) (branch (magit-read-local-branch "Reset branch" atpoint))) @@ -1433,19 +1423,17 @@ realize it's all crap and want to start over." nil nil nil 'magit-revision-history (or (and (not (equal branch atpoint)) atpoint) (magit-get-upstream-branch branch))) - (magit-branch-arguments)))) + (magit-branch-arguments) + current-prefix-arg))) (unless (member "--force" args) (setq args (cons "--force" args))) - (if (magit-branch-p to) - (unless (member "--track" args) - (setq args (cons "--track" args))) - (setq args (delete "--track" args))) (if (equal branch (magit-get-current-branch)) (if (and (magit-anything-modified-p) (not (yes-or-no-p "Uncommitted changes will be lost. Proceed?"))) (user-error "Abort") (magit-reset-hard to) - (magit-set-branch*merge/remote branch to)) + (when (and set-upstream (magit-branch-p to)) + (magit-set-branch*merge/remote branch to))) (magit-branch branch to args))) ;;;###autoload @@ -2259,92 +2247,6 @@ the current repository." (and (file-directory-p dir) (directory-files dir nil "^[^.]")))) -;;;; Submodules - -;;;###autoload (autoload 'magit-submodule-popup "magit" nil t) -(magit-define-popup magit-submodule-popup - "Popup console for submodule commands." - 'magit-commands nil nil - :man-page "git-submodule" - :actions '((?a "Add" magit-submodule-add) - (?b "Setup" magit-submodule-setup) - (?i "Init" magit-submodule-init) - (?u "Update" magit-submodule-update) - (?s "Sync" magit-submodule-sync) - (?f "Fetch" magit-submodule-fetch) - (?d "Deinit" magit-submodule-deinit))) - -;;;###autoload -(defun magit-submodule-add (url &optional path) - "Add the repository at URL as a submodule. -Optional PATH is the path to the submodule relative to the root -of the superproject. If it is nil then the path is determined -based on URL." - (interactive - (magit-with-toplevel - (let ((path (read-file-name - "Add submodule: " nil nil nil - (magit-section-when [file untracked] - (directory-file-name (magit-section-value it)))))) - (when path - (setq path (file-name-as-directory (expand-file-name path))) - (when (member path (list "" default-directory)) - (setq path nil))) - (list (magit-read-string-ns - "Remote url" - (and path (magit-git-repo-p path t) - (let ((default-directory path)) - (magit-get "remote" (or (magit-get-remote) "origin") - "url")))) - (and path (directory-file-name (file-relative-name path))))))) - (magit-run-git "submodule" "add" url path)) - -;;;###autoload -(defun magit-submodule-setup () - "Clone and register missing submodules and checkout appropriate commits." - (interactive) - (magit-submodule-update t)) - -;;;###autoload -(defun magit-submodule-init () - "Register submodules listed in \".gitmodules\" into \".git/config\"." - (interactive) - (magit-with-toplevel - (magit-run-git-async "submodule" "init"))) - -;;;###autoload -(defun magit-submodule-update (&optional init) - "Clone missing submodules and checkout appropriate commits. -With a prefix argument also register submodules in \".git/config\"." - (interactive "P") - (magit-with-toplevel - (magit-run-git-async "submodule" "update" (and init "--init")))) - -;;;###autoload -(defun magit-submodule-sync () - "Update each submodule's remote URL according to \".gitmodules\"." - (interactive) - (magit-with-toplevel - (magit-run-git-async "submodule" "sync"))) - -;;;###autoload -(defun magit-submodule-fetch (&optional all) - "Fetch all submodules. -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" ""))))) - -;;;###autoload -(defun magit-submodule-deinit (path) - "Unregister the submodule at PATH." - (interactive - (list (magit-completing-read "Deinit module" (magit-get-submodules) - nil t nil nil (magit-section-when module)))) - (magit-with-toplevel - (magit-run-git-async "submodule" "deinit" path))) - ;;;; File Mode (defvar magit-file-mode-map @@ -2935,7 +2837,7 @@ Git, and Emacs in the echo area." (when (called-interactively-p 'any) (message "Magit %s, Git %s, Emacs %s" (or magit-version "(unknown)") - (or (magit-git-version) "(unknown)") + (or (magit-git-version t) "(unknown)") emacs-version)) (setq debug (reverse debug)) (setq magit-version 'error) @@ -2944,16 +2846,8 @@ Git, and Emacs in the echo area." (message "Cannot determine Magit's version %S" debug)) magit-version)) -(defun magit-git-version (&optional numeric) - (--when-let (let (magit-git-global-arguments) - (ignore-errors (substring (magit-git-string "version") 12))) - (if numeric - (and (string-match "^\\([0-9]+\\.[0-9]+\\.[0-9]+\\)" it) - (match-string 1 it)) - it))) - (defun magit-startup-asserts () - (let ((version (magit-git-version t))) + (let ((version (magit-git-version))) (when (and version (version< version magit--minimal-git) (not (equal (getenv "TRAVIS") "true"))) @@ -3004,7 +2898,7 @@ library getting in the way. Then restart Emacs.\n" (-when-let (remote (file-remote-p directory)) (unless (member remote magit--remotes-using-recent-git) (-if-let (version (let ((default-directory directory)) - (magit-git-version t))) + (magit-git-version))) (if (version<= magit--minimal-git version) (push version magit--remotes-using-recent-git) (display-warning 'magit (format "\ @@ -3055,6 +2949,7 @@ doesn't find the executable, then consult the info node (require 'magit-stash) (require 'magit-blame) (unless (load "magit-autoloads" t t) + (require 'magit-submodule) (require 'magit-ediff) (require 'magit-extras) (require 'git-rebase))) diff --git a/elpa/magit-20160211.2105/magit.info b/elpa/magit-20160211.2105/magit.info new file mode 100644 index 00000000..957ce501 --- /dev/null +++ b/elpa/magit-20160211.2105/magit.info @@ -0,0 +1,163 @@ +This is magit.info, produced by makeinfo version 5.2 from magit.texi. + +Magit is an interface to the version control system Git, implemented as +an Emacs package. Magit aspires to be a complete Git porcelain. While +we cannot (yet) claim that Magit wraps and improves upon each and every +Git command, it is complete enough to allow even experienced Git users +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. + + Copyright (C) 2015-2016 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: 1222 +magit.info-2: 314834 + +Tag Table: +(Indirect) +Node: Top1222 +Node: Introduction5928 +Node: Installation10621 +Node: Updating from an older release10996 +Node: Installing from an Elpa archive12591 +Node: Installing from the Git repository13930 +Node: Post-installation tasks16726 +Node: Getting started18115 +Node: Interface concepts23850 +Node: Modes and Buffers24124 +Node: Switching Buffers25870 +Node: Naming Buffers28934 +Node: Quitting Windows31769 +Node: Automatic Refreshing of Magit Buffers33401 +Node: Automatic Saving of File-Visiting Buffers36169 +Node: Automatic Reverting of File-Visiting Buffers37354 +Node: Risk of Reverting Automatically42350 +Node: Sections44733 +Node: Section movement45674 +Node: Section visibility49601 +Node: Section hooks53192 +Node: Section types and values55473 +Node: Section options56743 +Node: Popup buffers and prefix commands57215 +Node: Completion and confirmation58529 +Node: Running Git61435 +Node: Viewing Git output61671 +Node: Running Git manually62671 +Node: Git executable64797 +Node: Global Git arguments66804 +Node: Inspecting67611 +Node: Status buffer68738 +Node: Status sections71261 +Node: Status header sections76008 +Node: Status options78567 +Node: Logging79291 +Node: Refreshing logs81820 +Node: Log Buffer83205 +Node: Select from log86294 +Node: Reflog87234 +Node: Diffing87712 +Node: Refreshing diffs90524 +Node: Diff buffer93505 +Node: Diff options95407 +Node: Revision buffer97039 +Node: Ediffing97994 +Node: References buffer101043 +Node: References sections105753 +Node: Bisecting106628 +Node: Visiting blobs108124 +Node: Blaming108633 +Node: Manipulating111953 +Node: Repository setup112245 +Node: Staging and unstaging113285 +Node: Staging from file-visiting buffers117180 +Node: Applying118348 +Node: Committing119991 +Node: Initiating a commit120574 +Node: Editing commit messages123886 +Node: Branching134282 +Node: Merging147096 +Node: Rebasing149180 +Node: Editing rebase sequences152128 +Node: Rebase sequence log155162 +Node: Cherry picking161906 +Node: Reverting163512 +Node: Resetting164875 +Node: Stashing166385 +Node: Transferring169530 +Node: Remotes169768 +Node: Fetching171054 +Node: Pulling172151 +Node: Pushing172997 +Node: Creating and sending patches177446 +Node: Applying patches178141 +Node: Miscellaneous179139 +Node: Tagging179430 +Node: Notes180215 +Node: Submodules182740 +Node: Common commands184060 +Node: Wip modes185808 +Node: Minor mode for buffers visiting files192544 +Node: Minor mode for buffers visiting blobs194687 +Node: Customizing195492 +Node: Per-repository configuration197164 +Node: Essential settings198798 +Node: Safety199122 +Node: Performance200955 +Node: Plumbing207184 +Node: Calling Git207812 +Node: Getting a value from Git209335 +Node: Calling Git for effect212439 +Node: Section plumbing218943 +Node: Creating sections219171 +Node: Section selection222974 +Node: Matching sections224654 +Node: Refreshing buffers229856 +Node: Conventions232991 +Node: Confirmation and completion233168 +Node: Theming Faces234066 +Node: FAQ242217 +Node: Magit is slow243550 +Node: I changed several thousand files at once and now Magit is unusable243751 +Node: I am having problems committing244467 +Node: I don't understand how branching and pushing work244925 +Node: I don't like the key binding in v24245294 +Node: I cannot install the pre-requisites for Magit v2245633 +Node: I am using an Emacs release older than v244246098 +Node: I am using a Git release older than v194247711 +Node: I am using MS Windows and cannot push with Magit248698 +Node: How to install the gitman info manual?249277 +Node: How can I show Git's output?251805 +Node: Expanding a file to show the diff causes it to disappear252617 +Node: Point is wrong in the COMMIT_EDITMSG buffer253143 +Node: Can Magit be used as ediff-version-control-package?254161 +Node: How to show diffs for gpg-encrypted files?256185 +Node: Emacs 245 hangs when loading Magit256776 +Node: Symbol's value as function is void --some257345 +Node: Where is the branch manager257665 +Node: Keystroke Index257950 +Node: Command Index285296 +Node: Function Index314834 +Node: Variable Index326617 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20160117.2129/magit.info-1 b/elpa/magit-20160211.2105/magit.info-1 similarity index 97% rename from elpa/magit-20160117.2129/magit.info-1 rename to elpa/magit-20160211.2105/magit.info-1 index 07bd6cf1..095a5c98 100644 --- a/elpa/magit-20160117.2129/magit.info-1 +++ b/elpa/magit-20160211.2105/magit.info-1 @@ -391,8 +391,7 @@ If you are updating from a release older than ‘2.1.0’, then you have to first uninstall the old version. See *note Updating from an older release: Updating from an older release. - Magit is available from all three of the popular unofficial Elpa -archives: Melpa, Melpa-Stable, and Marmalade. If you haven’t used + Magit is available from Melpa and Melpa-Stable. If you haven’t used Emacs’ package manager before, then it is high time you familiarize yourself with it by reading the documentation in the Emacs manual, see *note (emacs)Packages::. Then add one of the archives to @@ -410,12 +409,6 @@ yourself with it by reading the documentation in the Emacs manual, see (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) - • To use Marmalade: - - (require 'package) - (add-to-list 'package-archives - '("marmalade" . "http://marmalade-repo.org/packages/") t) - Once you have added your preferred archive, you need to update the local package list using: @@ -438,10 +431,16 @@ If you are updating from a release older than ‘2.1.0’, then you have to first uninstall the old version. See *note Updating from an older release: Updating from an older release. - Magit depends on the ‘dash’ library, available from all three of the -popular third-party Elpa archives. Install it using ‘M-x -package-install RET dash RET’. Of course you may also install it -manually from its development repository, but I won’t cover that here. + 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. + + (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.) Then clone the Magit repository: @@ -452,12 +451,14 @@ manually from its development repository, but I won’t cover that here. $ make - If you haven’t installed ‘dash’ using Elpa or at -‘/path/to/magit/../dash’, then you have to tell ‘make’ where to find it. -To do so create ‘/path/to/magit/config.mk’ with the following content -before running ‘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’: - LOAD_PATH = -L /path/to/magit/lisp -L /path/to/dash + LOAD_PATH = -L /path/to/magit/lisp + LOAD_PATH += -L /path/to/dash + LOAD_PATH += -L /path/to/with-editor Finally add this to your init file: @@ -469,11 +470,13 @@ before running ‘make’: (add-to-list 'Info-directory-list "~/.emacs.d/site-lisp/magit/Documentation/")) - Note that you have to add the ‘lisp/’ subdirectory to the -‘load-path’, not the top-level of the repository. + Note that you have to add the ‘lisp’ subdirectory to the ‘load-path’, +not the top-level of the repository, and that elements of ‘load-path’ +should not end with a slash, while those of ‘Info-directory-list’ +should. - Instead of requiring the feature ‘magit’, you could only load the -autoloads, by loading the file ‘magit-autoloads.el’. + Instead of requiring the feature ‘magit’, you could load just the +autoload definitions, by loading the file ‘magit-autoloads.el’. Instead of running Magit directly from the repository by adding that to the ‘load-path’, you might want to instead install it in some other @@ -989,9 +992,9 @@ i.e. "outside Emacs", making this a rather important feature. For example, if you discard a change in the status buffer, then that is done by running ‘git apply --reverse ...’, and Emacs considers the -file to have "change on disk". If Magit did not automaticallyrevert the -buffer, then you would have to type ‘M-x revert-buffer RET RET’ in the -visiting buffer before you could continue making changes. +file to have "changed on disk". If Magit did not automatically revert +the buffer, then you would have to type ‘M-x revert-buffer RET RET’ in +the visiting buffer before you could continue making changes. -- User Option: magit-auto-revert-mode @@ -1018,12 +1021,12 @@ visiting buffer before you could continue making changes. git for side-effects. If ‘auto-revert-use-notify’ is non-nil (and file notifications are - actually supported), then ‘magit-auto-revert-immediately’ should be - set to nil, because the reverts happen immediately anyway. + actually supported), then ‘magit-auto-revert-immediately’ does not + have to be non-nil, because the reverts happen immediately anyway. If ‘magit-auto-revert-immediately’ and ‘auto-revert-use-notify’ are - both nil, then reverts happen after ‘auto-revert-interval’ seconds - of user inactivity. That is not desirable. + both ‘nil’, then reverts happen after ‘auto-revert-interval’ + seconds of user inactivity. That is not desirable. -- User Option: auto-revert-use-notify @@ -1041,10 +1044,11 @@ visiting buffer before you could continue making changes. -- Command: auto-revert-mode The global mode ‘magit-auto-revert-mode’ works by turning on this - local mode in the appropriate buffers. You can also turn it on or - off manually, which might be necessary if Magit does not notice - that a previously untracked file now is being tracked or - vice-versa. + local mode in the appropriate buffers (but + ‘global-auto-revert-mode’ is implemented differently). You can + also turn it on or off manually, which might be necessary if Magit + does not notice that a previously untracked file now is being + tracked or vice-versa. -- User Option: auto-revert-stop-on-user-input @@ -1056,6 +1060,28 @@ visiting buffer before you could continue making changes. This option controls for how many seconds Emacs waits before resuming suspended reverts. + -- User Option: auto-revert-buffer-list-filter + + This option specifies an additional filter used by + ‘auto-revert-buffers’ to determine whether a buffer should be + reverted or not. + + This option is provided by ‘magit’, which also redefines + ‘auto-revert-buffers’ to respect it. Magit users who do not turn + on the local mode ‘auto-revert-mode’ themselves, are best served by + setting the value to ‘magit-auto-revert-repository-buffers-p’. + + However the default is nil, to not disturb users who do use the + local mode directly. If you experience delays when running Magit + commands, then you should consider using one of the predicates + provided by Magit - especially if you also use Tramp. + + Users who do turn on ‘auto-revert-mode’ in buffers in which Magit + doesn’t do that for them, should likely not use any filter. Users + who turn on ‘global-auto-revert-mode’, do not have to worry about + this option, because it is disregarded if the global mode is + enabled. + -- User Option: auto-revert-verbose This option controls whether Emacs reports when a buffer has been @@ -2054,7 +2080,9 @@ invoked while no log buffer exists for the current repository yet, then the default value of ‘magit-log-arguments’ is used instead. For information about the various arguments, see *note -(gitman)git-log:: . +(gitman)git-log:: . The switch ‘++order=VALUE’ is converted to one of +‘--author-date-order’, ‘--date-order’, or ‘--topo-order’ before being +passed to ‘git log’. The log popup also features several reflog commands. See *note Reflog: Reflog. @@ -3066,6 +3094,9 @@ the heading of a sibling section of the same type. once, a hunk, multiple hunks at once, and on parts of a hunk. These apply variants are described in the next section. + You can also use Ediff to stage and unstage. See *note Ediffing: +Ediffing. + ‘s’ (‘magit-stage’) Add the change at point to the staging area. @@ -3081,20 +3112,52 @@ apply variants are described in the next section. Remove the change at point from the staging area. + Only staged changes can be unstaged. But by default this command + performs an action that is somewhat similar to unstaging, when it + is called on a committed change: it reverses the change in the + index but not in the working tree. + ‘U’ (‘magit-unstage-all’) Remove all changes from the staging area. + -- User Option: magit-unstage-committed + + This option controls whether ‘magit-unstage’ "unstages" committed + changes by reversing them in the index but not the working tree. + The alternative is to raise an error. + +‘M-x magit-reverse-in-index’ (‘magit-reverse-in-index’) + + This command reverses the committed change at point in the index + but not the working tree. By default no key is bound directly to + this command, but it is indirectly called when ‘u’ + (‘magit-unstage’) is pressed on a committed change. + + This allows extracting a change from ‘HEAD’, while leaving it in + the working tree, so that it can later be committed using a + separate commit. A typical workflow would be: + + • Optionally make sure that there are no uncommitted changes. + + • Visit the ‘HEAD’ commit and navigate to the change that should + not have been included in that commit. + + • Type ‘u’ (‘magit-unstage’) to reverse it in the index. This + assumes that ‘magit-unstage-committed-changes’ is non-nil. + + • Type ‘c e’ to extend ‘HEAD’ with the staged changes, including + those that were already staged before. + + • Optionally stage the remaining changes using ‘s’ or ‘S’ and + then type ‘c c’ to create a new commit. + ‘M-x magit-reset-index’ (‘magit-reset-index’) Reset the index to some commit. The commit is read from the user and defaults to the commit at point. If there is no commit at point, then it defaults to ‘HEAD’. - To stage a smaller unit than a range of lines, similar to ‘git add ---patch’ followed by ‘e’ would do, then you can use ‘magit-ediff-stage’ -to do so. - * Menu: * Staging from file-visiting buffers:: @@ -3715,6 +3778,17 @@ e.g.: *note (gitman)git-checkout:: , and *note Pushing: Pushing. + -- User Option: magit-prefer-remote-upstream + + This option controls whether commands that read a branch from the + user and then set it as the upstream branch, offer a local or a + remote branch as default completion candidate, when they have the + choice. + + This affects all commands that use ‘magit-read-upstream-branch’ or + ‘magit-read-starting-point’, which includes all commands that + change the upstream and many which create new branches. + ‘b b’ (‘magit-checkout’) Checkout a revision read in the minibuffer and defaulting to the @@ -3762,9 +3836,6 @@ e.g.: This command resets a branch, defaulting to the branch at point, to the tip of another branch or any other commit. - When resetting to another branch, then that branch is also set as - the upstream of the branch being reset. - When the branch being reset is the current branch, then a hard reset is performed. If there are any uncommitted changes, then the user has to confirming the reset because those changes would be @@ -3773,6 +3844,10 @@ e.g.: This is useful when you have started work on a feature branch but realize it’s all crap and want to start over. + When resetting to another branch and a prefix argument is used, + then the target branch is set as the upstream of the branch that is + being reset. + ‘b d’ (‘magit-branch-delete’) Delete one or multiple branches. If the region marks multiple @@ -4519,7 +4594,10 @@ File: magit.info, Node: Fetching, Next: Pulling, Prev: Remotes, Up: Transfer 7.2 Fetching ============ -Also see *note (gitman)git-fetch:: . +For information about the differences between the _upstream_ and the +_push-remote_, see *note Branching: Branching. + + Also see *note (gitman)git-fetch:: . ‘f’ (‘magit-fetch-popup’) @@ -4557,7 +4635,10 @@ File: magit.info, Node: Pulling, Next: Pushing, Prev: Fetching, Up: Transfer 7.3 Pulling =========== -Also see *note (gitman)git-pull:: . +For information about the differences between the _upstream_ and the +_push-remote_, see *note Branching: Branching. + + Also see *note (gitman)git-pull:: . ‘F’ (‘magit-pull-popup’) @@ -4586,7 +4667,10 @@ File: magit.info, Node: Pushing, Next: Creating and sending patches, Prev: Pu 7.4 Pushing =========== -Also see *note (gitman)git-push:: . +For information about the differences between the _upstream_ and the +_push-remote_, see *note Branching: Branching. + + Also see *note (gitman)git-push:: . ‘P’ (‘magit-push-popup’) @@ -5347,8 +5431,25 @@ 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’ and ‘magit-status-refresh-hook’, -and if so whether those additions impacts performance significantly. +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 +‘*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 +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 +should help. + + (setq auto-revert-buffer-list-filter + 'magit-auto-revert-repository-buffers-p) + + For alternative approaches see *note Automatic Reverting of +File-Visiting Buffers: Automatic Reverting of File-Visiting Buffers. If you have enabled any features that are disabled by default, then you should check whether they impact performance significantly. It’s @@ -5420,11 +5521,11 @@ anymore. Consider leaving it at that. Diff Performance ................ - • ‘magit-diff-highlight-hunk-body’, - ‘magit-diff-highlight-indentation’, - ‘magit-diff-highlight-trailing’, and ‘magit-diff-paint-whitespace’ - - • ‘magit-diff-refine-hunk’ +If diffs are slow, then consider turning off some optional diff features +by setting all or some of the following variables to ‘nil’: +‘magit-diff-highlight-indentation’, ‘magit-diff-highlight-trailing’, +‘magit-diff-paint-whitespace’, ‘magit-diff-highlight-hunk-body’, and +‘magit-diff-refine-hunk’. Refs Buffer Performance ....................... @@ -6627,18 +6728,18 @@ Appendix B Keystroke Index * B: Bisecting. (line 8) * b: Branching. (line 45) * B b: Bisecting. (line 31) -* b b: Branching. (line 171) -* b c: Branching. (line 189) -* b d: Branching. (line 229) +* b b: Branching. (line 182) +* b c: Branching. (line 200) +* b d: Branching. (line 241) * B g: Bisecting. (line 36) * B k: Bisecting. (line 41) -* b n: Branching. (line 179) +* b n: Branching. (line 190) * B r: Bisecting. (line 47) -* b r: Branching. (line 235) +* b r: Branching. (line 247) * B s: Bisecting. (line 16) -* b s: Branching. (line 196) +* b s: Branching. (line 207) * B u: Bisecting. (line 24) -* b x: Branching. (line 213) +* b x: Branching. (line 224) * c: Initiating a commit. (line 8) * c <1>: Editing rebase sequences. (line 72) @@ -6742,16 +6843,16 @@ Appendix B Keystroke Index * E w: Ediffing. (line 58) * f: Editing rebase sequences. (line 63) -* f <1>: Fetching. (line 8) -* F: Pulling. (line 8) -* f a: Fetching. (line 25) -* f e: Fetching. (line 21) -* F e: Pulling. (line 21) -* f m: Fetching. (line 29) -* f p: Fetching. (line 13) -* F p: Pulling. (line 13) -* f u: Fetching. (line 17) -* F u: Pulling. (line 17) +* f <1>: Fetching. (line 11) +* F: Pulling. (line 11) +* f a: Fetching. (line 28) +* f e: Fetching. (line 24) +* F e: Pulling. (line 24) +* f m: Fetching. (line 32) +* f p: Fetching. (line 16) +* F p: Pulling. (line 16) +* f u: Fetching. (line 20) +* F u: Pulling. (line 20) * g: Automatic Refreshing of Magit Buffers. (line 22) * G: Automatic Refreshing of Magit Buffers. @@ -6762,17 +6863,17 @@ Appendix B Keystroke Index * k <2>: Editing rebase sequences. (line 68) * k <3>: Stashing. (line 92) -* l: Logging. (line 24) +* l: Logging. (line 26) * L: Refreshing logs. (line 11) * L <1>: Log Buffer. (line 6) -* l a: Logging. (line 54) -* l b: Logging. (line 50) +* l a: Logging. (line 56) +* l b: Logging. (line 52) * L g: Refreshing logs. (line 16) -* l h: Logging. (line 42) +* l h: Logging. (line 44) * l H: Reflog. (line 19) -* l l: Logging. (line 29) -* l L: Logging. (line 46) -* l o: Logging. (line 35) +* l l: Logging. (line 31) +* l L: Logging. (line 48) +* l o: Logging. (line 37) * l O: Reflog. (line 15) * l r: Reflog. (line 11) * L s: Refreshing logs. (line 21) @@ -6817,13 +6918,15 @@ Appendix B Keystroke Index * M-x magit-find-file: Visiting blobs. (line 6) * M-x magit-find-file-other-window: Visiting blobs. (line 11) * M-x magit-init: Repository setup. (line 6) -* M-x magit-log-buffer-file: Logging. (line 65) +* M-x magit-log-buffer-file: Logging. (line 67) * M-x magit-reset-hard: Resetting. (line 32) * M-x magit-reset-head: Resetting. (line 21) * M-x magit-reset-index: Staging and unstaging. - (line 45) + (line 84) * M-x magit-reset-index <1>: Resetting. (line 14) * M-x magit-reset-soft: Resetting. (line 26) +* M-x magit-reverse-in-index: Staging and unstaging. + (line 59) * M-x magit-stage-file: Staging from file-visiting buffers. (line 10) * M-x magit-toggle-buffer-lock: Modes and Buffers. (line 17) @@ -6851,16 +6954,16 @@ Appendix B Keystroke Index * P: Blaming. (line 66) * p <2>: Editing rebase sequences. (line 35) -* P <1>: Pushing. (line 8) +* P <1>: Pushing. (line 11) * p <3>: Minor mode for buffers visiting blobs. (line 12) -* P e: Pushing. (line 32) -* P m: Pushing. (line 41) -* P o: Pushing. (line 36) -* P p: Pushing. (line 13) -* P t: Pushing. (line 47) -* P T: Pushing. (line 53) -* P u: Pushing. (line 23) +* P e: Pushing. (line 35) +* P m: Pushing. (line 44) +* P o: Pushing. (line 39) +* P p: Pushing. (line 16) +* P t: Pushing. (line 50) +* P T: Pushing. (line 56) +* P u: Pushing. (line 26) * q: Quitting Windows. (line 6) * q <1>: Log Buffer. (line 12) * q <2>: Blaming. (line 70) @@ -6887,9 +6990,9 @@ Appendix B Keystroke Index * RET <3>: Editing rebase sequences. (line 16) * s: Staging and unstaging. - (line 26) + (line 29) * S: Staging and unstaging. - (line 30) + (line 33) * s <1>: Editing rebase sequences. (line 59) * s-: Section visibility. (line 22) @@ -6914,9 +7017,9 @@ Appendix B Keystroke Index * T T: Notes. (line 13) * TAB: Section visibility. (line 9) * u: Staging and unstaging. - (line 37) + (line 40) * U: Staging and unstaging. - (line 41) + (line 49) * v: Applying. (line 41) * V: Reverting. (line 6) * V A: Reverting. (line 30) @@ -6939,7 +7042,7 @@ Appendix B Keystroke Index * x: Editing rebase sequences. (line 76) * x <1>: Resetting. (line 8) -* Y: Logging. (line 60) +* Y: Logging. (line 62) * y: References buffer. (line 6) * y <1>: Editing rebase sequences. (line 85) @@ -7053,16 +7156,16 @@ Appendix C Command Index (line 45) * magit-blob-previous <1>: Minor mode for buffers visiting blobs. (line 12) -* magit-branch: Branching. (line 179) -* magit-branch-and-checkout: Branching. (line 189) -* magit-branch-delete: Branching. (line 229) +* magit-branch: Branching. (line 190) +* magit-branch-and-checkout: Branching. (line 200) +* magit-branch-delete: Branching. (line 241) * magit-branch-popup: Branching. (line 45) -* magit-branch-rename: Branching. (line 235) -* magit-branch-reset: Branching. (line 213) -* magit-branch-spinoff: Branching. (line 196) -* magit-checkout: Branching. (line 171) +* magit-branch-rename: Branching. (line 247) +* magit-branch-reset: Branching. (line 224) +* magit-branch-spinoff: Branching. (line 207) +* magit-checkout: Branching. (line 182) * magit-checkout-file: Resetting. (line 37) -* magit-cherry: Logging. (line 60) +* magit-cherry: Logging. (line 62) * magit-cherry-apply: Cherry picking. (line 22) * magit-cherry-pick: Cherry picking. (line 16) * magit-cherry-pick-popup: Cherry picking. (line 8) @@ -7126,11 +7229,11 @@ Appendix C Command Index * magit-ediff-show-unstaged: Ediffing. (line 50) * magit-ediff-show-working-tree: Ediffing. (line 58) * magit-ediff-stage: Ediffing. (line 45) -* magit-fetch: Fetching. (line 21) -* magit-fetch-all: Fetching. (line 25) -* magit-fetch-from-pushremote: Fetching. (line 13) -* magit-fetch-from-upstream: Fetching. (line 17) -* magit-fetch-popup: Fetching. (line 8) +* magit-fetch: Fetching. (line 24) +* magit-fetch-all: Fetching. (line 28) +* magit-fetch-from-pushremote: Fetching. (line 16) +* magit-fetch-from-upstream: Fetching. (line 20) +* magit-fetch-popup: Fetching. (line 11) * magit-file-popup: Minor mode for buffers visiting files. (line 19) * magit-find-file: Visiting blobs. (line 6) @@ -7149,19 +7252,19 @@ Appendix C Command Index * magit-jump-to-diffstat-or-diff: Diff buffer. (line 38) * magit-kill-this-buffer: Minor mode for buffers visiting blobs. (line 20) -* magit-log: Logging. (line 35) -* magit-log-all: Logging. (line 54) -* magit-log-all-branches: Logging. (line 50) -* magit-log-branches: Logging. (line 46) -* magit-log-buffer-file: Logging. (line 65) +* magit-log: Logging. (line 37) +* magit-log-all: Logging. (line 56) +* magit-log-all-branches: Logging. (line 52) +* magit-log-branches: Logging. (line 48) +* magit-log-buffer-file: Logging. (line 67) * magit-log-buffer-file <1>: Minor mode for buffers visiting files. (line 33) * magit-log-bury-buffer: Log Buffer. (line 12) -* magit-log-current: Logging. (line 29) +* magit-log-current: Logging. (line 31) * magit-log-double-commit-limit: Log Buffer. (line 53) * magit-log-half-commit-limit: Log Buffer. (line 57) -* magit-log-head: Logging. (line 42) -* magit-log-popup: Logging. (line 24) +* magit-log-head: Logging. (line 44) +* magit-log-popup: Logging. (line 26) * magit-log-refresh: Refreshing logs. (line 16) * magit-log-refresh-popup: Refreshing logs. (line 11) * magit-log-refresh-popup <1>: Log Buffer. (line 6) @@ -7193,20 +7296,20 @@ Appendix C Command Index (line 63) * magit-process: Viewing Git output. (line 11) * magit-process-kill: Viewing Git output. (line 19) -* magit-pull: Pulling. (line 21) -* magit-pull-from-pushremote: Pulling. (line 13) -* magit-pull-from-upstream: Pulling. (line 17) -* magit-pull-popup: Pulling. (line 8) -* magit-push: Pushing. (line 36) -* magit-push-current: Pushing. (line 32) -* magit-push-current-to-pushremote: Pushing. (line 13) -* magit-push-current-to-upstream: Pushing. (line 23) -* magit-push-implicitly args: Pushing. (line 61) -* magit-push-matching: Pushing. (line 41) -* magit-push-popup: Pushing. (line 8) -* magit-push-tag: Pushing. (line 53) -* magit-push-tags: Pushing. (line 47) -* magit-push-to-remote remote args: Pushing. (line 72) +* magit-pull: Pulling. (line 24) +* magit-pull-from-pushremote: Pulling. (line 16) +* magit-pull-from-upstream: Pulling. (line 20) +* magit-pull-popup: Pulling. (line 11) +* magit-push: Pushing. (line 39) +* magit-push-current: Pushing. (line 35) +* magit-push-current-to-pushremote: Pushing. (line 16) +* magit-push-current-to-upstream: Pushing. (line 26) +* magit-push-implicitly args: Pushing. (line 64) +* magit-push-matching: Pushing. (line 44) +* magit-push-popup: Pushing. (line 11) +* magit-push-tag: Pushing. (line 56) +* magit-push-tags: Pushing. (line 50) +* magit-push-to-remote remote args: Pushing. (line 75) * magit-rebase: Rebasing. (line 25) * magit-rebase-abort: Rebasing. (line 84) * magit-rebase-autosquash: Rebasing. (line 57) @@ -7238,10 +7341,12 @@ Appendix C Command Index * magit-reset-hard: Resetting. (line 32) * magit-reset-head: Resetting. (line 21) * magit-reset-index: Staging and unstaging. - (line 45) + (line 84) * magit-reset-index <1>: Resetting. (line 14) * magit-reset-soft: Resetting. (line 26) * magit-reverse: Applying. (line 41) +* magit-reverse-in-index: Staging and unstaging. + (line 59) * magit-revert: Reverting. (line 14) * magit-revert-no-commit: Reverting. (line 20) * magit-revert-popup: Reverting. (line 6) @@ -7298,13 +7403,13 @@ Appendix C Command Index * magit-snapshot-index: Stashing. (line 46) * magit-snapshot-worktree: Stashing. (line 51) * magit-stage: Staging and unstaging. - (line 26) + (line 29) * magit-stage-file: Staging from file-visiting buffers. (line 10) * magit-stage-file <1>: Minor mode for buffers visiting files. (line 24) * magit-stage-modified: Staging and unstaging. - (line 30) + (line 33) * magit-stash: Stashing. (line 13) * magit-stash-apply: Stashing. (line 58) * magit-stash-branch: Stashing. (line 84) @@ -7321,7 +7426,7 @@ Appendix C Command Index * magit-stash-worktree: Stashing. (line 25) * magit-status: Status buffer. (line 22) * magit-submodule-add: Submodules. (line 13) -* magit-submodule-fetch: Fetching. (line 29) +* magit-submodule-fetch: Fetching. (line 32) * magit-submodule-fetch <1>: Submodules. (line 37) * magit-submodule-init: Submodules. (line 24) * magit-submodule-init <1>: Submodules. (line 41) @@ -7336,9 +7441,9 @@ Appendix C Command Index * magit-toggle-buffer-lock: Modes and Buffers. (line 17) * magit-toggle-margin: Refreshing logs. (line 36) * magit-unstage: Staging and unstaging. - (line 37) + (line 40) * magit-unstage-all: Staging and unstaging. - (line 41) + (line 49) * magit-unstage-file: Staging from file-visiting buffers. (line 18) * magit-unstage-file <1>: Minor mode for buffers visiting files. diff --git a/elpa/magit-20160117.2129/magit.info-2 b/elpa/magit-20160211.2105/magit.info-2 similarity index 98% rename from elpa/magit-20160117.2129/magit.info-2 rename to elpa/magit-20160211.2105/magit.info-2 index 0706819cb0454fc7e2b5120167d24e4a3a19de9a..bbd3ef1770e6ba7eb763c9ddc8a6437198c53399 100644 GIT binary patch delta 196 zcmX@JfpOnv#toZP8BHc{R`r-*AlfETAlT8x~vj!$>4U-Wxj{!B4p){WXFtb55 tJpltCI54w;Hfak2G&hs%K}P~KF|##7>Isu*OvV8;voB5S2(zPB8v|rm9!vlL diff --git a/elpa/magit-popup-20160117.1513/dir b/elpa/magit-popup-20160130.649/dir similarity index 100% rename from elpa/magit-popup-20160117.1513/dir rename to elpa/magit-popup-20160130.649/dir diff --git a/elpa/magit-popup-20160117.1513/magit-popup-autoloads.el b/elpa/magit-popup-20160130.649/magit-popup-autoloads.el similarity index 92% rename from elpa/magit-popup-20160117.1513/magit-popup-autoloads.el rename to elpa/magit-popup-20160130.649/magit-popup-autoloads.el index 7aee4d5f..1c2eb166 100644 --- a/elpa/magit-popup-20160117.1513/magit-popup-autoloads.el +++ b/elpa/magit-popup-20160130.649/magit-popup-autoloads.el @@ -4,7 +4,7 @@ (add-to-list 'load-path (or (file-name-directory #$) (car load-path))) ;;;### (autoloads nil nil ("magit-popup-pkg.el" "magit-popup.el") -;;;;;; (22173 11883 146783 0)) +;;;;;; (22206 285 159684 0)) ;;;*** diff --git a/elpa/magit-popup-20160117.1513/magit-popup-pkg.el b/elpa/magit-popup-20160130.649/magit-popup-pkg.el similarity index 67% rename from elpa/magit-popup-20160117.1513/magit-popup-pkg.el rename to elpa/magit-popup-20160130.649/magit-popup-pkg.el index 44c56818..a62d46bb 100644 --- a/elpa/magit-popup-20160117.1513/magit-popup-pkg.el +++ b/elpa/magit-popup-20160130.649/magit-popup-pkg.el @@ -1,4 +1,4 @@ -(define-package "magit-popup" "20160117.1513" "Define prefix-infix-suffix command combos" +(define-package "magit-popup" "20160130.649" "Define prefix-infix-suffix command combos" '((emacs "24.4") (async "20150909.2257") (dash "20151021.113")) diff --git a/elpa/magit-popup-20160117.1513/magit-popup.el b/elpa/magit-popup-20160130.649/magit-popup.el similarity index 99% rename from elpa/magit-popup-20160117.1513/magit-popup.el rename to elpa/magit-popup-20160130.649/magit-popup.el index 78c53539..6119f7ce 100644 --- a/elpa/magit-popup-20160117.1513/magit-popup.el +++ b/elpa/magit-popup-20160130.649/magit-popup.el @@ -248,7 +248,7 @@ make it impossible to invoke certain actions.") (define-button-type 'magit-popup-variable-button 'supertype 'magit-popup-button - 'function 'magit-invoke-popup-variable + 'function 'magit-invoke-popup-action 'property :variables 'heading "Variables\n" 'formatter 'magit-popup-format-variable-button diff --git a/elpa/magit-popup-20160117.1513/magit-popup.info b/elpa/magit-popup-20160130.649/magit-popup.info similarity index 100% rename from elpa/magit-popup-20160117.1513/magit-popup.info rename to elpa/magit-popup-20160130.649/magit-popup.info -- 2.47.3