From 769059819d9f11add499cbbeac376a30e5b18e56 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Thu, 24 Dec 2015 17:31:46 +0100 Subject: [PATCH] updating magit. --- elpa/magit-20151119.202/magit-remote.el | 432 --------- elpa/magit-20151119.202/magit.info | 158 ---- elpa/magit-20151119.202/magit.info-2 | Bin 8846 -> 0 bytes .../AUTHORS.md | 5 + .../COPYING | 0 .../dir | 0 .../git-rebase.el | 119 ++- .../magit-apply.el | 3 +- .../magit-autoloads.el | 364 +++++-- .../magit-bisect.el | 4 +- .../magit-blame.el | 17 +- .../magit-commit.el | 12 +- .../magit-core.el | 2 +- .../magit-diff.el | 121 +-- .../magit-ediff.el | 2 +- .../magit-extras.el | 21 +- .../magit-git.el | 224 +++-- .../magit-log.el | 184 ++-- .../magit-mode.el | 30 +- .../magit-pkg.el | 4 +- .../magit-process.el | 54 +- elpa/magit-20151223.1425/magit-remote.el | 668 +++++++++++++ .../magit-section.el | 99 +- .../magit-sequence.el | 110 ++- .../magit-stash.el | 11 +- .../magit-utils.el | 6 +- .../magit-wip.el | 2 +- .../magit.el | 576 +++++++++--- elpa/magit-20151223.1425/magit.info | 158 ++++ .../magit.info-1 | 886 ++++++++++-------- elpa/magit-20151223.1425/magit.info-2 | Bin 0 -> 21336 bytes .../dir | 0 .../magit-popup-autoloads.el | 2 +- .../magit-popup-pkg.el | 2 +- .../magit-popup.el | 279 ++++-- .../magit-popup.info | 48 +- .../dir | 0 .../with-editor-autoloads.el | 2 +- .../with-editor-pkg.el | 5 +- .../with-editor.el | 131 ++- .../with-editor.info | 10 +- elpa/with-editor-readme.txt | 46 + 42 files changed, 3086 insertions(+), 1711 deletions(-) delete mode 100644 elpa/magit-20151119.202/magit-remote.el delete mode 100644 elpa/magit-20151119.202/magit.info delete mode 100644 elpa/magit-20151119.202/magit.info-2 rename elpa/{magit-20151119.202 => magit-20151223.1425}/AUTHORS.md (97%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/COPYING (100%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/dir (100%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/git-rebase.el (77%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-apply.el (99%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-autoloads.el (79%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-bisect.el (98%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-blame.el (98%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-commit.el (97%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-core.el (97%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-diff.el (96%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-ediff.el (99%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-extras.el (91%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-git.el (86%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-log.el (91%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-mode.el (97%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-pkg.el (71%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-process.el (95%) create mode 100644 elpa/magit-20151223.1425/magit-remote.el rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-section.el (93%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-sequence.el (87%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-stash.el (97%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-utils.el (98%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit-wip.el (99%) rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit.el (84%) create mode 100644 elpa/magit-20151223.1425/magit.info rename elpa/{magit-20151119.202 => magit-20151223.1425}/magit.info-1 (93%) create mode 100644 elpa/magit-20151223.1425/magit.info-2 rename elpa/{magit-popup-20151119.201 => magit-popup-20151223.1341}/dir (100%) rename elpa/{magit-popup-20151119.201 => magit-popup-20151223.1341}/magit-popup-autoloads.el (92%) rename elpa/{magit-popup-20151119.201 => magit-popup-20151223.1341}/magit-popup-pkg.el (67%) rename elpa/{magit-popup-20151119.201 => magit-popup-20151223.1341}/magit-popup.el (81%) rename elpa/{magit-popup-20151119.201 => magit-popup-20151223.1341}/magit-popup.info (94%) rename elpa/{with-editor-20150701.1246 => with-editor-20151223.1341}/dir (100%) rename elpa/{with-editor-20150701.1246 => with-editor-20151223.1341}/with-editor-autoloads.el (92%) rename elpa/{with-editor-20150701.1246 => with-editor-20151223.1341}/with-editor-pkg.el (55%) rename elpa/{with-editor-20150701.1246 => with-editor-20151223.1341}/with-editor.el (86%) rename elpa/{with-editor-20150701.1246 => with-editor-20151223.1341}/with-editor.info (97%) create mode 100644 elpa/with-editor-readme.txt diff --git a/elpa/magit-20151119.202/magit-remote.el b/elpa/magit-20151119.202/magit-remote.el deleted file mode 100644 index 26667140..00000000 --- a/elpa/magit-20151119.202/magit-remote.el +++ /dev/null @@ -1,432 +0,0 @@ -;;; magit-remote.el --- transfer Git commits - -;; Copyright (C) 2008-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. - -;;; Commentary: - -;; This library implements support for interacting with remote -;; repositories. Commands for cloning, fetching, pulling, and -;; pushing are defined here. - -;;; Code: - -(require 'magit) - -;;; Clone - -;;;###autoload -(defun magit-clone (repository directory) - "Clone the REPOSITORY to DIRECTORY. -Then show the status buffer for the new repository." - (interactive - (let ((url (magit-read-string-ns "Clone repository"))) - (list url (read-directory-name - "Clone to: " nil nil nil - (and (string-match "\\([^./]+\\)\\(\\.git\\)?$" url) - (match-string 1 url)))))) - (setq directory (file-name-as-directory (expand-file-name directory))) - (message "Cloning %s..." repository) - (when (= (magit-call-git "clone" repository - ;; Stop cygwin git making a "c:" directory. - (magit-convert-git-filename directory)) - 0) - (message "Cloning %s...done" repository) - (magit-status-internal directory))) - -;;; Setup - -;;;###autoload (autoload 'magit-remote-popup "magit-remote" nil t) -(magit-define-popup magit-remote-popup - "Popup console for remote commands." - 'magit-commands nil nil - :man-page "git-remote" - :actions '((?a "Add" magit-remote-add) - (?r "Rename" magit-remote-rename) - (?k "Remove" magit-remote-remove) - (?u "Set url" magit-remote-set-url))) - -(defun magit-read-url (prompt &optional initial-input) - (let ((url (magit-read-string-ns prompt initial-input))) - (if (string-prefix-p "~" url) - (expand-file-name url) - url))) - -;;;###autoload -(defun magit-remote-add (remote url) - "Add a remote named REMOTE and fetch it." - (interactive (list (magit-read-string-ns "Remote name") - (magit-read-url "Remote url"))) - (magit-run-git-async "remote" "add" "-f" remote url)) - -;;;###autoload -(defun magit-remote-rename (old new) - "Rename the remote named OLD to NEW." - (interactive - (let ((remote (magit-read-remote "Rename remote"))) - (list remote (magit-read-string-ns (format "Rename %s to" remote))))) - (unless (string= old new) - (magit-run-git "remote" "rename" old new))) - -;;;###autoload -(defun magit-remote-set-url (remote url) - "Change the url of the remote named REMOTE to URL." - (interactive - (let ((remote (magit-read-remote "Set url of remote"))) - (list remote (magit-read-url - "Url" (magit-get "remote" remote "url"))))) - (magit-run-git "remote" "set-url" remote url)) - -;;;###autoload -(defun magit-remote-remove (remote) - "Delete the remote named REMOTE." - (interactive (list (magit-read-remote "Delete remote"))) - (magit-run-git "remote" "rm" remote)) - -;;; Fetch - -;;;###autoload (autoload 'magit-fetch-popup "magit-remote" nil t) -(magit-define-popup magit-fetch-popup - "Popup console for fetch commands." - 'magit-commands - :man-page "git-fetch" - :switches '((?p "Prune" "--prune")) - :actions '((?f "Current" magit-fetch-current) - (?o "Other" magit-fetch) - (?a "All" magit-fetch-all) - (?m "Submodules" magit-submodule-fetch)) - :default-action 'magit-fetch-current) - -;;;###autoload -(defun magit-fetch-current (remote &optional args) - "Fetch from the upstream repository of the current branch. -If `HEAD' is detached or if the upstream is not configured, -then read the remote." - (interactive (list (or (magit-get-remote) - (magit-read-remote "Fetch remote")) - (magit-fetch-arguments))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "fetch" remote args)) - -;;;###autoload -(defun magit-fetch (remote &optional args) - "Fetch from another repository." - (interactive (list (magit-read-remote "Fetch remote") - (magit-fetch-arguments))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "fetch" remote args)) - -;;;###autoload -(defun magit-fetch-all (&optional args) - "Fetch from all configured remotes." - (interactive (list (magit-fetch-arguments))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "remote" "update" args)) - -;;; Pull - -;;;###autoload (autoload 'magit-pull-popup "magit-remote" nil t) -(magit-define-popup magit-pull-popup - "Popup console for pull commands." - 'magit-commands - :man-page "git-pull" - :switches '((?r "Rebase" "--rebase")) - :actions '((?F "Current" magit-pull-current) - (?o "Other" magit-pull)) - :default-action 'magit-pull-current) - -;;;###autoload -(defun magit-pull-current (remote branch &optional args) - "Fetch and merge into current branch." - (interactive (magit-pull-read-args t)) - (run-hooks 'magit-credential-hook) - (magit-run-git-with-editor "pull" args - (and (not (equal remote (magit-get-remote))) - (not (equal branch (magit-get-remote-branch))) - (list remote branch)))) - -;;;###autoload -(defun magit-pull (remote branch &optional args) - "Fetch from another repository and merge a fetched branch." - (interactive (magit-pull-read-args)) - (run-hooks 'magit-credential-hook) - (magit-run-git-with-editor "pull" args remote branch)) - -(defun magit-pull-read-args (&optional use-upstream) - (let ((remote (magit-get-remote-branch))) - (unless (and use-upstream remote) - (setq remote (magit-read-remote-branch "Pull" nil remote nil t))) - (list (car remote) (cdr remote) (magit-pull-arguments)))) - -;;; Push - -;;;###autoload (autoload 'magit-push-popup "magit-remote" nil t) -(magit-define-popup magit-push-popup - "Popup console for push commands." - 'magit-commands - :man-page "git-push" - :switches '((?f "Force" "--force-with-lease") - (?h "Disable hooks" "--no-verify") - (?d "Dry run" "--dry-run") - (?u "Set upstream" "--set-upstream")) - :actions '((?P "Current" magit-push-current) - (?Q "Quickly" magit-push-quickly) - (?t "Tags" magit-push-tags) - (?o "Other" magit-push) - (?i "Implicitly" magit-push-implicitly) - (?T "Tag" magit-push-tag) - (?e "Elsewhere" magit-push-elsewhere) - (?m "Matching" magit-push-matching)) - :default-action 'magit-push-current - :max-action-columns 3) - -;;;###autoload -(defun magit-push-current (branch remote &optional remote-branch args) - "Push the current branch to its upstream branch. -If the upstream isn't set, then read the remote branch. - -If `magit-push-always-verify' is not nil, however, always read -the remote branch." - (interactive (magit-push-read-args t t)) - (magit-push branch remote remote-branch args)) - -;;;###autoload -(defun magit-push (branch remote &optional remote-branch args) - "Push a branch to its upstream branch. -If the upstream isn't set, then read the remote branch. - -If `magit-push-always-verify' is not nil, however, always read -the remote branch." - (interactive (magit-push-read-args t)) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert - "push" "-v" args remote - (if remote-branch - (format "%s:refs/heads/%s" branch remote-branch) - branch))) - -;;;###autoload -(defun magit-push-elsewhere (branch remote remote-branch &optional args) - "Push a branch or commit to some remote branch. -Read the local and remote branch." - (interactive (magit-push-read-args nil nil t)) - (magit-push branch remote remote-branch args)) - -(defcustom magit-push-always-verify 'nag - "Whether certain commands require verification before pushing. - -Starting with v2.1.0 some of the push commands are supposed to -push to the configured upstream branch without requiring user -confirmation or offering to push somewhere else. - -This has taken a few users by surprise, and they suggested that -we force users to opt-in to this behavior. Unfortunately adding -this option means that now other users will complain about us -needlessly forcing them to set an option. But what can you do? -\(I am not making this up. This has happened in the past and it -is very frustrating.) - -You should set the value of this option to nil, causing all push -commands to behave as intended: - -`PP' Push the current branch to its upstream branch, no questions - asked. If no upstream branch is configured or if that is - another local branch, then prompt for the remote and branch - to push to. - -`Po' Push another local branch (not the current branch) to its - upstream branch. If no upstream branch is configured or if - that is another local branch, then prompt for the remote and - branch to push to. - -`Pe' Push any local branch to any remote branch. This command - isn't affected by this option. It always asks which branch - should be pushed (defaulting to the current branch) and then - where that should be pushed (defaulting to the upstream - branch of the previously selected branch). - -There are other push commands besides these. You should read -their doc-strings instead of blindly trying them out and then -being surprised if it turns out that they do something different -from what you expected. For example inside the push popup type -`?i' to learn what \"implicitly\" means here. Or to learn about -all push commands at once, consult the manual. - -While I have your attention, I would also like to warn you that -pushing will be further improved in the v2.4.0 release, and that -you might be surprised by some of these changes, unless you read -the documentation. - -Setting this option to t makes little sense. If you consider -doing that, then you should probably just use `Pe' instead of -`PP' or `Po'." - :package-version '(magit . "2.2.0") - :group 'magit-commands - :type '(choice (const :tag "require verification and mention this option" nag) - (const :tag "require verification" t) - (const :tag "don't require verification" nil))) - -(defun magit-push-read-args (&optional use-upstream use-current default-current) - (let* ((current (magit-get-current-branch)) - (local (or (and use-current current) - (magit-completing-read - "Push" (--if-let (magit-commit-at-point) - (cons it (magit-list-local-branch-names)) - (magit-list-local-branch-names)) - nil nil nil 'magit-revision-history - (or (and default-current current) - (magit-local-branch-at-point) - (magit-commit-at-point))) - (user-error "Nothing selected"))) - (remote (and (magit-branch-p local) - (magit-get-remote-branch local)))) - (unless (and use-upstream remote (not magit-push-always-verify)) - (setq remote (magit-read-remote-branch - (concat - (format "Push %s to" local) - (and use-upstream remote - (eq magit-push-always-verify 'nag) - " [also see option magit-push-always-verify]")) - nil remote local 'confirm))) - (list local (car remote) (cdr remote) (magit-push-arguments)))) - -;;;###autoload -(defun magit-push-quickly (&optional args) - "Push the current branch to some remote. -When the Git variable `magit.pushRemote' is set, then push to -that remote. If that variable is undefined or the remote does -not exist, then push to \"origin\". If that also doesn't exist -then raise an error. The local branch is pushed to the remote -branch with the same name." - (interactive (list (magit-push-arguments))) - (run-hooks 'magit-credential-hook) - (-if-let (branch (magit-get-current-branch)) - (-if-let (remote (or (magit-remote-p (magit-get "magit.pushRemote")) - (magit-remote-p "origin"))) - (magit-run-git-async-no-revert "push" "-v" args remote branch) - (user-error "Cannot determine remote to push to")) - (user-error "No branch is checked out"))) - -;;;###autoload -(defun magit-push-implicitly (&optional args) - "Push without explicitly specifing what to push. -This runs `git push -v'. What is being pushed depends on various -Git variables as described in the `git-push(1)' and `git-config(1)' -manpages." - (interactive (list (magit-push-arguments))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "push" "-v" args)) - -;;;###autoload -(defun magit-push-matching (remote &optional args) - "Push all matching branches to another repository. -If multiple remotes exit, then read one from the user. -If just one exists, use that without requiring confirmation." - (interactive (list (magit-read-remote "Push matching branches to" nil t))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "push" "-v" args remote ":")) - -(defun magit-push-tags (remote &optional args) - "Push all tags to another repository. -If only one remote exists, then push to that. Otherwise prompt -for a remote, offering the remote configured for the current -branch as default." - (interactive (list (magit-read-remote "Push tags to remote" nil t) - (magit-push-arguments))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "push" remote "--tags" args)) - -;;;###autoload -(defun magit-push-tag (tag remote &optional args) - "Push a tag to another repository." - (interactive - (let ((tag (magit-read-tag "Push tag"))) - (list tag (magit-read-remote (format "Push %s to remote" tag) nil t)))) - (run-hooks 'magit-credential-hook) - (magit-run-git-async-no-revert "push" remote tag)) - -;;; Email - -;;;###autoload (autoload 'magit-patch-popup "magit-remote" nil t) -(magit-define-popup magit-patch-popup - "Popup console for patch commands." - 'magit-commands - :man-page "git-format-patch" - :options '((?f "From" "--from=") - (?t "To" "--to=") - (?c "CC" "--cc=") - (?r "In reply to" "--in-reply-to=") - (?v "Reroll count" "--reroll-count=") - (?s "Thread style" "--thread=") - (?U "Context lines" "-U") - (?M "Detect renames" "-M") - (?C "Detect copies" "-C") - (?A "Diff algorithm" "--diff-algorithm=" - magit-diff-select-algorithm) - (?o "Output directory" "--output-directory=")) - :actions '((?p "Format patches" magit-format-patch) - (?r "Request pull" magit-request-pull)) - :default-action 'magit-format-patch) - -;;;###autoload -(defun magit-format-patch (range args) - "Create patches for the commits in RANGE. -When a single commit is given for RANGE, create a patch for the -changes introduced by that commit (unlike 'git format-patch' -which creates patches for all commits that are reachable from -HEAD but not from the specified commit)." - (interactive - (list (-if-let (revs (magit-region-values 'commit)) - (concat (car (last revs)) "^.." (car revs)) - (let ((range (magit-read-range-or-commit "Format range or commit"))) - (if (string-match-p "\\.\\." range) - range - (format "%s~..%s" range range)))) - (magit-patch-arguments))) - (magit-run-git-no-revert "format-patch" range args)) - -;;;###autoload -(defun magit-request-pull (url start end) - "Request upstream to pull from you public repository. - -URL is the url of your publically accessible repository. -START is a commit that already is in the upstream repository. -END is the last commit, usually a branch name, which upstream -is asked to pull. START has to be reachable from that commit." - (interactive - (list (magit-get "remote" (magit-read-remote "Remote") "url") - (magit-read-branch-or-commit "Start" (magit-get-tracked-branch)) - (magit-read-branch-or-commit "End"))) - (let ((dir default-directory)) - ;; mu4e changes default-directory - (compose-mail) - (setq default-directory dir)) - (message-goto-body) - (let ((inhibit-magit-revert t)) - (magit-git-insert "request-pull" start url)) - (set-buffer-modified-p nil)) - -;;; magit-remote.el ends soon -(provide 'magit-remote) -;; Local Variables: -;; indent-tabs-mode: nil -;; End: -;;; magit-remote.el ends here diff --git a/elpa/magit-20151119.202/magit.info b/elpa/magit-20151119.202/magit.info deleted file mode 100644 index 54473215..00000000 --- a/elpa/magit-20151119.202/magit.info +++ /dev/null @@ -1,158 +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 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: 1217 -magit.info-2: 304678 - -Tag Table: -(Indirect) -Node: Top1217 -Node: Introduction5669 -Node: Installation10362 -Node: Updating from an older release10737 -Node: Installing from an Elpa archive12332 -Node: Installing from the Git repository13911 -Node: Post-installation tasks16155 -Node: Getting started17681 -Node: Interface concepts23416 -Node: Modes and Buffers23742 -Node: Switching Buffers25357 -Node: Naming Buffers28421 -Node: Quitting Windows31256 -Node: Automatic save32842 -Node: Automatic refresh and revert33907 -Node: Sections38567 -Node: Section movement39519 -Node: Section visibility43446 -Node: Section hooks47037 -Node: Section types and values49075 -Node: Section options50345 -Node: Popup buffers and prefix commands50817 -Node: Completion and confirmation52131 -Node: Running Git55037 -Node: Viewing Git output55273 -Node: Running Git manually56273 -Node: Git executable58399 -Node: Global Git arguments60406 -Node: Inspecting61213 -Node: Status buffer62340 -Node: Status sections64884 -Node: Status header sections69227 -Node: Status options71057 -Node: Logging71781 -Node: Refreshing logs74148 -Node: Log Buffer75533 -Node: Select from log78622 -Node: Reflog79562 -Node: Diffing80040 -Node: Refreshing diffs83036 -Node: Diff buffer86017 -Node: Diff options87919 -Node: Revision buffer89551 -Node: Ediffing90506 -Node: References buffer93555 -Node: References sections98265 -Node: Bisecting99140 -Node: Visiting blobs100636 -Node: Blaming101145 -Node: Manipulating104465 -Node: Repository setup104757 -Node: Staging and unstaging105520 -Node: Staging from file-visiting buffers107869 -Node: Applying109037 -Node: Committing110680 -Node: Initiating a commit111263 -Node: Editing commit messages114575 -Node: Branching124971 -Node: Merging128663 -Node: Rebasing130747 -Node: Editing rebase sequences133734 -Node: Rebase sequence log136768 -Node: Cherry picking143512 -Node: Reverting145118 -Node: Resetting146481 -Node: Stashing147991 -Node: Transferring151136 -Node: Remotes151374 -Node: Fetching152177 -Node: Pulling152993 -Node: Pushing153493 -Node: Creating and sending patches156472 -Node: Applying patches157167 -Node: Miscellaneous158165 -Node: Tagging158456 -Node: Notes159241 -Node: Submodules161766 -Node: Common commands163086 -Node: Wip modes164834 -Node: Minor mode for buffers visiting files171570 -Node: Minor mode for buffers visiting blobs173713 -Node: Customizing174518 -Node: Per-repository configuration176190 -Node: Essential settings177838 -Node: Safety178162 -Node: Performance181343 -Node: Plumbing187297 -Node: Calling Git187925 -Node: Getting a value from Git189448 -Node: Calling Git for effect192552 -Node: Section plumbing199056 -Node: Creating sections199284 -Node: Section selection203087 -Node: Matching sections204767 -Node: Refreshing buffers209969 -Node: Conventions213104 -Node: Confirmation and completion213281 -Node: Theming Faces214179 -Node: FAQ222330 -Node: Magit is slow223499 -Node: I changed several thousand files at once and now Magit is unusable223700 -Node: I am having problems committing224416 -Node: I don't like how branching and pushing works224869 -Node: I cannot install the pre-requisits for Magit v2225348 -Node: I am using an Emacs release older than v244225819 -Node: I am using a Git release older than v194227431 -Node: I am using MS Windows and cannot push with Magit228418 -Node: How to install the gitman info manual?228997 -Node: How can I show Git's output?231579 -Node: Expanding a file to show the diff causes it to disappear232391 -Node: Point is wrong in the COMMIT_EDITMSG buffer232917 -Node: Can Magit be used as ediff-version-control-package?233935 -Node: How to show diffs for gpg-encrypted files?235959 -Node: Emacs 245 hangs when loading Magit236550 -Node: Keystroke Index237069 -Node: Command Index264479 -Node: Function Index292553 -Node: Variable Index304678 - -End Tag Table - - -Local Variables: -coding: utf-8 -End: diff --git a/elpa/magit-20151119.202/magit.info-2 b/elpa/magit-20151119.202/magit.info-2 deleted file mode 100644 index 2cf10161a3a265b71e5ca3bc6025dcd0275fd286..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8846 zcmcgx?{C{U65Wpr{}acL?V`%n`Ozl1#p2R5>E_U;IosKwINS$XqHS&@Q6;4~{_pP% zNlBFK=x~Rm#$r?0k}4Jnn{V*_y`XQ|gV08* zoE`1$vxQcf-%*N3xi=bpq3wjjb0+gr=mn1jD-|nOqS+d&ywoaXW@Ac`u}`vm!(>*Z zA`{q>Fm6WJev$Fmu!6_;d@1%AbI{xrQVTTg9p|C>fSfpI$Sbn#XsTi#V zi+P@_lD*o9@->U`YX)O@>G9T@7i4Wh7HIVV=&FEwg2yZSwSdE$5uxKz85Y7;>tXX` zk*jLCB8zyMsx`w7?0+nTmLezmXme%2+X!p$^+M?kYcpj^+QQU==#iQwT&9~Xno4f& z4NKs5T;gXUeYBS4N_viJXAy}UKg-;a5vO>3X<&&oAXw$t>p6tCuxTVqBhm#+1Z;b- zQ39ngEP~Aql?G8|^f_0>M$6?2RGz>n!UhJ6qk45X=Kzy3*I{C)1e*h}Sa ze(yI`Q5={S35?NlULj)e0B)(cqOcR!e^r`gDv^r~QC#JT&^B+7MwxL&II7sE>s$6o zYVNOck{0wL>AoQx5y;%{5uGj&I~=<2N!bw{EReK_mbe-mWDQ0rVqJ z7FGJj!Gk7tcQyO{>+Ou4U4LVDXOqd<_3YcbyoG+t00$`O=;mD={=!G>JP3ZpQnOdA*CMQ zFm|KG!zsJ0@|a@Te0^J-vY9GIqqCwAc_JU#MQ`uum#03X(N91BOA`K1KmVIN6M1zy z!atU>j7T}~XMq^w-)WWQr{2}(&qX3j^4cwBnJ@;j2SS?_|JOfWr6dRY`^T^QrsOyw z(f11C7A-sx##!~UrW_pfOu5h1I*$q?szgOA!Ex%nA&kAKDdYXao+%msQ|Sm2grwcGA$|Z9x~akUEP{*U)ryt$A5n#&7$)n3Y;bGDm5x ztfVyu2-Li+E$qZeORDBPMT(HzLFdHoQ}jjVuEq;SrDI+#7C7zfK^muiwDY+FHXc** zIE(lKH9CUo3tjF!RA)%64DCRS7G;6{()E6B!}DnH_-$a%Jmr~)mI~P%ud4ih%cc)l zfO1e*M3>=C%-PBN)-eY}s)^MRHI}^Wq~Z|Ju@xQ1kOQ)L5f(p8vZE9wR?0;6Wv{n2Loq$>!3*~{rboBiI`uYeNU`kZ_4h}jJoCl;M8Uj1w zpnKS39?0pli<$=#k0tt*2-Az!G7%9PTMsx0bkcI+Spl(tctaHBr4IGVc{!zB2f1VS|#z7KcDp^D;j6W%jK+xI*LyLWw zH|Qf4_~F3Coz85XL;=%1pi-l6hLeq3Y!Jv6As2fKRAAUGqxDLb!eCVHq|p%2_+1-& z3k2Cirx=kKwWg2@_zVHD4v;BQK5#^)XyRkct;_JN)f@$4gkdQJ$`$5R48N^mLqOwz zBVm0@)-sE%w5i;B*h(9U;{uL%h1Og2E^y5OeaHFUl4{4%5Kwqxmv(9`MXe)Fm3#wE z4i1S?NH!JPM9ixobDSmh|NoF;O;lsjXBZWW3KG&JWI%QU#C{$B)>2%`YzXKmsPDM@#jI!|lw-`9=%bYGCebf#g*XaSxd!sBZK1SU1&+|+YdNt zlNQEuOc?z02yhcr3KY z_LTLdd|*kPjy|v5tv#+>-R0vm_0eG>qFq6EOL<3^b5C2+@u=n|OhgYY+Q@F*H(!%~Vy;#Zjc_ZD@qq5m#8y zFiiBdf75|X4)1R4eJ%wnig9;S-$m6)gTDh(KOP5_el3g0O#{3rQoMrbznZy|1-&xH zrE!4nqjeHw@-86MdR*lQr$Pfj - Brian Warner - Bryan Shell +- Carl Lieberman - Chris Bernard - Chris Done - Chris Moore @@ -82,6 +83,7 @@ Contributors - Dan LaManna - David Abrahams - David Hull +- David L. Rager - David Wallin - Dennis Paskorz - Divye Kapoor @@ -145,8 +147,10 @@ Contributors - Matus Goljer - Michael Fogleman - Michael Griffiths +- Michael Heerdegen - Michal Sojka - Miles Bader +- Miloš Mošić - Mitchel Humpherys - Moritz Bunkus - Natalie Weizenbaum @@ -210,6 +214,7 @@ Contributors - Steven Vancoillie - Steve Purcell - Suhail Shergill +- Sylvain Rousseau - Syohei Yoshida - Takafumi Arakaki - Teemu Likonen diff --git a/elpa/magit-20151119.202/COPYING b/elpa/magit-20151223.1425/COPYING similarity index 100% rename from elpa/magit-20151119.202/COPYING rename to elpa/magit-20151223.1425/COPYING diff --git a/elpa/magit-20151119.202/dir b/elpa/magit-20151223.1425/dir similarity index 100% rename from elpa/magit-20151119.202/dir rename to elpa/magit-20151223.1425/dir diff --git a/elpa/magit-20151119.202/git-rebase.el b/elpa/magit-20151223.1425/git-rebase.el similarity index 77% rename from elpa/magit-20151119.202/git-rebase.el rename to elpa/magit-20151223.1425/git-rebase.el index 8ae5f10c..1ef275f0 100644 --- a/elpa/magit-20151119.202/git-rebase.el +++ b/elpa/magit-20151223.1425/git-rebase.el @@ -1,4 +1,4 @@ -;;; git-rebase.el --- Edit Git rebase files +;;; git-rebase.el --- Edit Git rebase files -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -145,6 +145,7 @@ "Keymap for Git-Rebase mode.") (put 'git-rebase-reword :advertised-binding "r") +(put 'git-rebase-move-line-up :advertised-binding (kbd "M-p")) (easy-menu-define git-rebase-mode-menu git-rebase-mode-map "Git-Rebase mode menu" @@ -214,29 +215,79 @@ (forward-line))) (ding))) -(defun git-rebase-move-line-up () - "Move the current commit (or command) up." - (interactive) - (goto-char (line-beginning-position)) - (if (bobp) - (ding) - (when (looking-at git-rebase-line) - (let ((inhibit-read-only t)) - (transpose-lines 1)) - (forward-line -2)))) - -(defun git-rebase-move-line-down () - "Move the current commit (or command) down." - (interactive) - (goto-char (line-beginning-position)) - (when (and (looking-at git-rebase-line) - (save-excursion - (forward-line) - (looking-at git-rebase-line))) - (forward-line) - (let ((inhibit-read-only t)) - (transpose-lines 1)) - (forward-line -1))) +(defun git-rebase-line-p (&optional pos) + (save-excursion + (when pos (goto-char pos)) + (goto-char (line-beginning-position)) + (looking-at-p git-rebase-line))) + +(defun git-rebase-region-bounds () + (when (use-region-p) + (let ((beg (save-excursion (goto-char (region-beginning)) + (line-beginning-position))) + (end (save-excursion (goto-char (region-end)) + (line-end-position)))) + (when (and (git-rebase-line-p beg) + (git-rebase-line-p end)) + (list beg (1+ end)))))) + +(defun git-rebase-move-line-down (n) + "Move the current commit (or command) N lines down. +If N is negative, move the commit up instead. With an active +region, move all the lines that the region touches, not just the +current line." + (interactive "p") + (-let* (((beg end) (or (git-rebase-region-bounds) + (list (line-beginning-position) + (1+ (line-end-position))))) + (pt-offset (- (point) beg)) + (mark-offset (and mark-active (- (mark) beg)))) + (save-restriction + (narrow-to-region + (point-min) + (1+ (save-excursion + (goto-char (point-min)) + (while (re-search-forward git-rebase-line nil t)) + (point)))) + (if (or (and (< n 0) (= beg (point-min))) + (and (> n 0) (= end (point-max))) + (> end (point-max))) + (ding) + (goto-char (if (< n 0) beg end)) + (forward-line n) + (atomic-change-group + (let ((inhibit-read-only t)) + (insert (delete-and-extract-region beg end))) + (let ((new-beg (- (point) (- end beg)))) + (when (use-region-p) + (setq deactivate-mark nil) + (set-mark (+ new-beg mark-offset))) + (goto-char (+ new-beg pt-offset)))))))) + +(defun git-rebase-move-line-up (n) + "Move the current commit (or command) N lines up. +If N is negative, move the commit down instead. With an active +region, move all the lines that the region touches, not just the +current line." + (interactive "p") + (git-rebase-move-line-down (- n))) + +(defun git-rebase-highlight-region (start end window rol) + (let ((inhibit-read-only t) + (deactivate-mark nil) + (bounds (git-rebase-region-bounds))) + (mapc #'delete-overlay magit-section-highlight-overlays) + (when bounds + (magit-section-make-overlay (car bounds) (cadr bounds) + 'magit-section-heading-selection)) + (if (and bounds (not magit-keep-region-overlay)) + (funcall (default-value 'redisplay-unhighlight-region-function) rol) + (funcall (default-value 'redisplay-highlight-region-function) + start end window rol)))) + +(defun git-rebase-unhighlight-region (rol) + (mapc #'delete-overlay magit-section-highlight-overlays) + (funcall (default-value 'redisplay-unhighlight-region-function) rol)) (defun git-rebase-kill-line () "Kill the current action line." @@ -329,6 +380,8 @@ running 'man git-rebase' at the command line) for details." (when git-rebase-confirm-cancel (add-hook 'with-editor-cancel-query-functions 'git-rebase-cancel-confirm nil t)) + (setq-local redisplay-highlight-region-function 'git-rebase-highlight-region) + (setq-local redisplay-unhighlight-region-function 'git-rebase-unhighlight-region) (add-hook 'with-editor-pre-cancel-hook 'git-rebase-autostash-save nil t) (add-hook 'with-editor-post-cancel-hook 'git-rebase-autostash-apply nil t)) @@ -370,15 +423,17 @@ By default, this is the same except for the \"pick\" command." (substitute-command-keys (format "\\[%s]" (car it))) (cdr it)))) (while (re-search-forward "^#\\( ?\\)\\([^,],\\) \\([^ ]+\\) = " nil t) - (replace-match " " t t nil 1) (let ((cmd (intern (concat "git-rebase-" (match-string 3))))) - (replace-match - (format "%-8s" - (mapconcat #'key-description - (--filter (not (eq (elt it 0) 'menu-bar)) - (reverse (where-is-internal cmd))) - ", ")) - t t nil 2))))))) + (if (not (fboundp cmd)) + (delete-region (line-beginning-position) (1+ (line-end-position))) + (replace-match " " t t nil 1) + (replace-match + (format "%-8s" + (mapconcat #'key-description + (--filter (not (eq (elt it 0) 'menu-bar)) + (reverse (where-is-internal cmd))) + ", ")) + t t nil 2)))))))) (add-hook 'git-rebase-mode-hook 'git-rebase-mode-show-keybindings t) diff --git a/elpa/magit-20151119.202/magit-apply.el b/elpa/magit-20151223.1425/magit-apply.el similarity index 99% rename from elpa/magit-20151119.202/magit-apply.el rename to elpa/magit-20151223.1425/magit-apply.el index 2c2c5a48..850a83cb 100644 --- a/elpa/magit-20151119.202/magit-apply.el +++ b/elpa/magit-20151223.1425/magit-apply.el @@ -1,4 +1,4 @@ -;;; magit-apply.el --- apply Git diffs +;;; magit-apply.el --- apply Git diffs -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -39,6 +39,7 @@ ;; For `magit-discard-files' (declare-function magit-checkout-stage 'magit) (declare-function magit-checkout-read-stage 'magit) +(defvar auto-revert-verbose) (require 'dired) diff --git a/elpa/magit-20151119.202/magit-autoloads.el b/elpa/magit-20151223.1425/magit-autoloads.el similarity index 79% rename from elpa/magit-20151119.202/magit-autoloads.el rename to elpa/magit-20151223.1425/magit-autoloads.el index 144338ab..c5347fd8 100644 --- a/elpa/magit-20151119.202/magit-autoloads.el +++ b/elpa/magit-20151223.1425/magit-autoloads.el @@ -3,7 +3,7 @@ ;;; Code: (add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads nil "git-rebase" "git-rebase.el" (22093 56217 0 +;;;### (autoloads nil "git-rebase" "git-rebase.el" (22140 7080 0 ;;;;;; 0)) ;;; Generated autoloads from git-rebase.el @@ -23,7 +23,7 @@ running 'man git-rebase' at the command line) for details. ;;;*** -;;;### (autoloads nil "magit" "magit.el" (22093 56217 0 0)) +;;;### (autoloads nil "magit" "magit.el" (22140 7080 0 0)) ;;; Generated autoloads from magit.el (autoload 'magit-status "magit" "\ @@ -136,6 +136,12 @@ anyway and the previously current branch is not touched. This is useful to create a feature branch after work has already began on the old branch (likely but not necessarily \"master\"). +If the current branch is a member of the value of option +`magit-branch-prefer-remote-upstream' (which see), then the +current branch will be used as the starting point as usual, but +the upstream of the starting-point may be used as the upstream +of the new branch, instead of the starting-point itself. + \(fn BRANCH &rest ARGS)" t nil) (autoload 'magit-branch-reset "magit" "\ @@ -161,16 +167,6 @@ defaulting to the branch at point. \(fn BRANCHES &optional FORCE)" t nil) -(autoload 'magit-branch-set-upstream "magit" "\ -Change the UPSTREAM branch of BRANCH. - -\(fn BRANCH UPSTREAM)" t nil) - -(autoload 'magit-branch-unset-upstream "magit" "\ -Unset the upstream branch of BRANCH. - -\(fn BRANCH)" t nil) - (autoload 'magit-branch-rename "magit" "\ Rename branch OLD to NEW. With prefix, forces the rename even if NEW already exists. @@ -179,10 +175,121 @@ With prefix, forces the rename even if NEW already exists. \(fn OLD NEW &optional FORCE)" t nil) -(autoload 'magit-branch-edit-description "magit" "\ -Edit the description of BRANCH. +(autoload 'magit-edit-branch*description "magit" "\ +Edit the description of the current branch. +With a prefix argument edit the description of another branch. + +The description for the branch named NAME is stored in the Git +variable `branch..description'. + +\(fn BRANCH)" t nil) + +(autoload 'magit-set-branch*merge/remote "magit" "\ +Set or unset the upstream of the current branch. +With a prefix argument do so for another branch. + +When the branch in question already has an upstream then simply +unsets it. Invoke this command again to set another upstream. + +Together the Git variables `branch..remote' and +`branch..merge' define the upstream branch of the local +branch named NAME. The value of `branch..remote' is the +name of the upstream remote. The value of `branch..merge' +is the full reference of the upstream branch, on the remote. + +\(fn BRANCH UPSTREAM)" t nil) + +(autoload 'magit-cycle-branch*rebase "magit" "\ +Cycle the value of `branch..rebase' for the current branch. +With a prefix argument cycle the value for another branch. + +The Git variables `branch..rebase' controls whether pulling +into the branch named NAME is done by rebasing that branch onto +the fetched branch or by merging that branch. + +When `true' then pulling is done by rebasing. +When `false' then pulling is done by merging. + +When that variable is undefined then the value of `pull.rebase' +is used instead. It defaults to `false'. \(fn BRANCH)" t nil) + +(autoload 'magit-cycle-branch*pushRemote "magit" "\ +Cycle the value of `branch..pushRemote' for the current branch. +With a prefix argument cycle the value for another branch. + +The Git variable `branch..pushRemote' specifies the remote +that the branch named NAME is usually pushed to. The value has +to be the name of an existing remote. + +If that variable is undefined, then the value of the Git variable +`remote.pushDefault' is used instead, provided that it is defined, +which by default it is not. + +\(fn BRANCH)" t nil) + +(autoload 'magit-cycle-pull\.rebase "magit" "\ +Cycle the repository-local value of `pull.rebase'. + +The Git variable `pull.rebase' specifies whether pulling is done +by rebasing or by merging. It can be overwritten using the Git +variable `branch..rebase'. + +When `true' then pulling is done by rebasing. +When `false' (the default) then pulling is done by merging. + +\(fn)" t nil) + +(autoload 'magit-cycle-remote\.pushDefault "magit" "\ +Cycle the repository-local value of `remote.pushDefault'. + +The Git variable `remote.pushDefault' specifies the remote that +local branches are usually pushed to. It can be overwritten +using the Git variable `branch..pushRemote'. + +\(fn)" t nil) + +(autoload 'magit-cycle-branch*autoSetupMerge "magit" "\ +Cycle the repository-local value of `branch.autoSetupMerge'. + +The Git variable `branch.autoSetupMerge' under what circumstances +creating a branch (named NAME) should result in the variables +`branch..merge' and `branch..remote' being set +according to the starting point used to create the branch. If +the starting point isn't a branch, then these variables are never +set. + +When `always' then the variables are set regardless of whether +the starting point is a local or a remote branch. + +When `true' (the default) then the variable are set when the +starting point is a remote branch, but not when it is a local +branch. + +When `false' then the variables are never set. + +\(fn)" t nil) + +(autoload 'magit-cycle-branch*autoSetupRebase "magit" "\ +Cycle the repository-local value of `branch.autoSetupRebase'. + +The Git variable `branch.autoSetupRebase' specifies whether +creating a branch (named NAME) should result in the variable +`branch..rebase' being set to `true'. + +When `always' then the variable is set regardless of whether the +starting point is a local or a remote branch. + +When `local' then the variable are set when the starting point +is a local branch, but not when it is a remote branch. + +When `remote' then the variable are set when the starting point +is a remote branch, but not when it is a local branch. + +When `never' (the default) then the variable is never set. + +\(fn)" t nil) (autoload 'magit-merge-popup "magit" nil t) (autoload 'magit-merge "magit" "\ @@ -231,7 +338,7 @@ Abort the current merge operation. (autoload 'magit-reset-index "magit" "\ Reset the index to COMMIT. Keep the head and working tree as-is, so if COMMIT refers to the -head this effectivley unstages all changes. +head this effectively unstages all changes. \(git reset COMMIT) @@ -385,7 +492,7 @@ Git, and Emacs in the echo area. ;;;*** -;;;### (autoloads nil "magit-apply" "magit-apply.el" (22093 56217 +;;;### (autoloads nil "magit-apply" "magit-apply.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-apply.el @@ -422,7 +529,7 @@ Remove all changes from the staging area. ;;;*** -;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22093 56217 +;;;### (autoloads nil "magit-bisect" "magit-bisect.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect-popup "magit-bisect" nil t) @@ -474,7 +581,7 @@ bisect run'. ;;;*** -;;;### (autoloads nil "magit-blame" "magit-blame.el" (22093 56217 +;;;### (autoloads nil "magit-blame" "magit-blame.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-blame.el (autoload 'magit-blame-popup "magit-blame" nil t) @@ -499,7 +606,7 @@ only arguments available from `magit-blame-popup' should be used. ;;;*** -;;;### (autoloads nil "magit-commit" "magit-commit.el" (22093 56217 +;;;### (autoloads nil "magit-commit" "magit-commit.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-commit.el @@ -582,7 +689,7 @@ Create a squash commit targeting COMMIT and instantly rebase. ;;;*** -;;;### (autoloads nil "magit-diff" "magit-diff.el" (22093 56217 0 +;;;### (autoloads nil "magit-diff" "magit-diff.el" (22140 7080 0 ;;;;;; 0)) ;;; Generated autoloads from magit-diff.el @@ -626,21 +733,11 @@ Show changes between the working tree and the index. \(fn &optional ARGS FILES)" t nil) -(autoload 'magit-diff-unpushed "magit-diff" "\ -Show unpushed changes. - -\(fn &optional ARGS FILES)" t nil) - -(autoload 'magit-diff-unpulled "magit-diff" "\ -Show unpulled changes. - -\(fn &optional ARGS FILES)" t nil) - (autoload 'magit-diff-while-committing "magit-diff" "\ While committing, show the changes that are about to be committed. While amending, invoking the command again toggles between showing just the new changes or all the changes that will -be commited. +be committed. \(fn &optional ARGS FILES)" t nil) @@ -658,7 +755,7 @@ for a revision. ;;;*** -;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22093 56217 +;;;### (autoloads nil "magit-ediff" "magit-ediff.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-ediff.el (autoload 'magit-ediff-popup "magit-ediff" nil t) @@ -739,7 +836,7 @@ Show changes introduced by COMMIT using Ediff. ;;;*** -;;;### (autoloads nil "magit-extras" "magit-extras.el" (22093 56217 +;;;### (autoloads nil "magit-extras" "magit-extras.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-extras.el @@ -810,7 +907,7 @@ on a position in a file-visiting buffer. ;;;*** -;;;### (autoloads nil "magit-log" "magit-log.el" (22093 56217 0 0)) +;;;### (autoloads nil "magit-log" "magit-log.el" (22140 7080 0 0)) ;;; Generated autoloads from magit-log.el (autoload 'magit-log-current "magit-log" "\ @@ -878,7 +975,7 @@ Show commits in a branch that are not merged in the upstream branch. ;;;*** -;;;### (autoloads nil "magit-remote" "magit-remote.el" (22093 56217 +;;;### (autoloads nil "magit-remote" "magit-remote.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-remote.el @@ -910,88 +1007,150 @@ Delete the remote named REMOTE. \(fn REMOTE)" t nil) (autoload 'magit-fetch-popup "magit-remote" nil t) -(autoload 'magit-fetch-current "magit-remote" "\ +(autoload 'magit-fetch-from-pushremote "magit-remote" "\ +Fetch from the push-remote of the current branch. + +\(fn ARGS)" t nil) + +(autoload 'magit-fetch-from-upstream "magit-remote" "\ Fetch from the upstream repository of the current branch. -If `HEAD' is detached or if the upstream is not configured, -then read the remote. -\(fn REMOTE &optional ARGS)" t nil) +\(fn ARGS)" t nil) (autoload 'magit-fetch "magit-remote" "\ Fetch from another repository. -\(fn REMOTE &optional ARGS)" t nil) +\(fn REMOTE ARGS)" t nil) (autoload 'magit-fetch-all "magit-remote" "\ -Fetch from all configured remotes. +Fetch from all remotes. -\(fn &optional ARGS)" t nil) +\(fn ARGS)" t nil) + +(autoload 'magit-fetch-all-prune "magit-remote" "\ +Fetch from all remotes, and prune. +Prune remote tracking branches for branches that have been +removed on the respective remote. + +\(fn)" t nil) + +(autoload 'magit-fetch-all-no-prune "magit-remote" "\ +Fetch from all remotes. + +\(fn)" t nil) (autoload 'magit-pull-popup "magit-remote" nil t) + (autoload 'magit-pull-and-fetch-popup "magit-remote" nil t) -(autoload 'magit-pull-current "magit-remote" "\ -Fetch and merge into current branch. +(autoload 'magit-pull-from-pushremote "magit-remote" "\ +Pull from the push-remote of the current branch. -\(fn REMOTE BRANCH &optional ARGS)" t nil) +\(fn ARGS)" t nil) -(autoload 'magit-pull "magit-remote" "\ -Fetch from another repository and merge a fetched branch. +(autoload 'magit-pull-from-upstream "magit-remote" "\ +Pull from the upstream of the current branch. -\(fn REMOTE BRANCH &optional ARGS)" t nil) - (autoload 'magit-push-popup "magit-remote" nil t) +\(fn ARGS)" t nil) -(autoload 'magit-push-current "magit-remote" "\ -Push the current branch to its upstream branch. -If the upstream isn't set, then read the remote branch. +(autoload 'magit-pull "magit-remote" "\ +Pull from a branch read in the minibuffer. -If `magit-push-always-verify' is not nil, however, always read -the remote branch. +\(fn SOURCE ARGS)" t nil) + (autoload 'magit-push-popup "magit-remote" nil t) -\(fn BRANCH REMOTE &optional REMOTE-BRANCH ARGS)" t nil) +(autoload 'magit-push-current-to-pushremote "magit-remote" "\ +Push the current branch to `branch..pushRemote'. +If that variable is unset, then push to `remote.pushDefault'. -(autoload 'magit-push "magit-remote" "\ -Push a branch to its upstream branch. -If the upstream isn't set, then read the remote branch. +When `magit-push-current-set-remote-if-missing' is non-nil and +the push-remote is not configured, then read the push-remote from +the user, set it, and then push to it. With a prefix argument +the push-remote can be changed before pushed to it. -If `magit-push-always-verify' is not nil, however, always read -the remote branch. +\(fn ARGS &optional PUSH-REMOTE)" t nil) -\(fn BRANCH REMOTE &optional REMOTE-BRANCH ARGS)" t nil) +(autoload 'magit-push-current-to-upstream "magit-remote" "\ +Push the current branch to its upstream branch. -(autoload 'magit-push-elsewhere "magit-remote" "\ -Push a branch or commit to some remote branch. -Read the local and remote branch. +When `magit-push-current-set-remote-if-missing' is non-nil and +the upstream is not configured, then read the upstream from the +user, set it, and then push to it. With a prefix argument the +upstream can be changed before pushed to it. -\(fn BRANCH REMOTE REMOTE-BRANCH &optional ARGS)" t nil) +\(fn ARGS &optional UPSTREAM)" t nil) -(autoload 'magit-push-quickly "magit-remote" "\ -Push the current branch to some remote. -When the Git variable `magit.pushRemote' is set, then push to -that remote. If that variable is undefined or the remote does -not exist, then push to \"origin\". If that also doesn't exist -then raise an error. The local branch is pushed to the remote -branch with the same name. +(autoload 'magit-push-current "magit-remote" "\ +Push the current branch to a branch read in the minibuffer. -\(fn &optional ARGS)" t nil) +\(fn TARGET ARGS)" t nil) -(autoload 'magit-push-implicitly "magit-remote" "\ -Push without explicitly specifing what to push. -This runs `git push -v'. What is being pushed depends on various -Git variables as described in the `git-push(1)' and `git-config(1)' -manpages. +(autoload 'magit-push "magit-remote" "\ +Push an arbitrary branch or commit somewhere. +Both the source and the target are read in the minibuffer. -\(fn &optional ARGS)" t nil) +\(fn SOURCE TARGET ARGS)" t nil) (autoload 'magit-push-matching "magit-remote" "\ Push all matching branches to another repository. -If multiple remotes exit, then read one from the user. +If multiple remotes exist, then read one from the user. If just one exists, use that without requiring confirmation. \(fn REMOTE &optional ARGS)" t nil) +(autoload 'magit-push-tags "magit-remote" "\ +Push all tags to another repository. +If only one remote exists, then push to that. Otherwise prompt +for a remote, offering the remote configured for the current +branch as default. + +\(fn REMOTE &optional ARGS)" t nil) + (autoload 'magit-push-tag "magit-remote" "\ Push a tag to another repository. \(fn TAG REMOTE &optional ARGS)" t nil) + +(autoload 'magit-push-implicitly "magit-remote" "\ +Push somewhere without using an explicit refspec. + +This command simply runs \"git push -v [ARGS]\". ARGS are the +arguments specified in the popup buffer. No explicit refspec +arguments are used. Instead the behavior depends on at least +these Git variables: `push.default', `branch.pushDefault', +`branch..pushRemote', `branch..remote', +`branch..merge', and `remote..push'. + +To add this command to the push popup add this to your init file: + + (with-eval-after-load \\='magit-remote + (magit-define-popup-action \\='magit-push-popup ?P + 'magit-push-implicitly--desc + 'magit-push-implicitly ?p t)) + +The function `magit-push-implicitly--desc' attempts to predict +what this command will do, the value it returns is displayed in +the popup buffer. + +\(fn ARGS)" t nil) + +(autoload 'magit-push-to-remote "magit-remote" "\ +Push to REMOTE without using an explicit refspec. +The REMOTE is read in the minibuffer. + +This command simply runs \"git push -v [ARGS] REMOTE\". ARGS +are the arguments specified in the popup buffer. No refspec +arguments are used. Instead the behavior depends on at least +these Git variables: `push.default', `branch.pushDefault', +`branch..pushRemote', `branch..remote', +`branch..merge', and `remote..push'. + +To add this command to the push popup add this to your init file: + + (with-eval-after-load \\='magit-remote + (magit-define-popup-action \\='magit-push-popup ?r + 'magit-push-to-remote--desc + 'magit-push-to-remote ?p t)) + +\(fn REMOTE ARGS)" t nil) (autoload 'magit-patch-popup "magit-remote" nil t) (autoload 'magit-format-patch "magit-remote" "\ @@ -1015,8 +1174,8 @@ is asked to pull. START has to be reachable from that commit. ;;;*** -;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22093 -;;;;;; 56217 0 0)) +;;;### (autoloads nil "magit-sequence" "magit-sequence.el" (22140 +;;;;;; 7080 0 0)) ;;; Generated autoloads from magit-sequence.el (autoload 'magit-sequencer-continue "magit-sequence" "\ @@ -1097,43 +1256,50 @@ This discards all changes made since the sequence started. \(fn)" t nil) (autoload 'magit-rebase-popup "magit-sequence" nil t) +(autoload 'magit-rebase-onto-pushremote "magit-sequence" "\ +Rebase the current branch onto `branch..pushRemote'. +If that variable is unset, then rebase onto `remote.pushDefault'. + +\(fn ARGS)" t nil) + +(autoload 'magit-rebase-onto-upstream "magit-sequence" "\ +Rebase the current branch onto its upstream branch. + +\(fn ARGS)" t nil) + (autoload 'magit-rebase "magit-sequence" "\ -Start a non-interactive rebase sequence. -All commits not in UPSTREAM are rebased. +Rebase the current branch onto a branch read in the minibuffer. +All commits that are reachable from head but not from the +selected branch TARGET are being rebased. -\(fn UPSTREAM &optional ARGS)" t nil) +\(fn TARGET ARGS)" t nil) (autoload 'magit-rebase-subset "magit-sequence" "\ -Start a non-interactive rebase sequence. +Rebase a subset of the current branches history onto a new base. Rebase commits from START to `HEAD' onto NEWBASE. START has to be selected from a list of recent commits. -\(fn NEWBASE START &optional ARGS)" t nil) +\(fn NEWBASE START ARGS)" t nil) (autoload 'magit-rebase-interactive "magit-sequence" "\ Start an interactive rebase sequence. -\(fn COMMIT &optional ARGS)" t nil) - -(autoload 'magit-rebase-unpushed "magit-sequence" "\ -Start an interactive rebase sequence of all unpushed commits. - -\(fn &optional ARGS)" t nil) +\(fn COMMIT ARGS)" t nil) (autoload 'magit-rebase-autosquash "magit-sequence" "\ Combine squash and fixup commits with their intended targets. -\(fn &optional ARGS)" t nil) +\(fn ARGS)" t nil) (autoload 'magit-rebase-edit-commit "magit-sequence" "\ Edit a single older commit using rebase. -\(fn COMMIT &optional ARGS)" t nil) +\(fn COMMIT ARGS)" t nil) (autoload 'magit-rebase-reword-commit "magit-sequence" "\ Reword a single older commit using rebase. -\(fn COMMIT &optional ARGS)" t nil) +\(fn COMMIT ARGS)" t nil) (autoload 'magit-rebase-continue "magit-sequence" "\ Restart the current rebasing operation. @@ -1157,7 +1323,7 @@ Abort the current rebase operation, restoring the original branch. ;;;*** -;;;### (autoloads nil "magit-stash" "magit-stash.el" (22093 56217 +;;;### (autoloads nil "magit-stash" "magit-stash.el" (22140 7080 ;;;;;; 0 0)) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash-popup "magit-stash" nil t) @@ -1257,7 +1423,7 @@ Show all diffs of a stash in a buffer. ;;;*** -;;;### (autoloads nil "magit-wip" "magit-wip.el" (22093 56217 0 0)) +;;;### (autoloads nil "magit-wip" "magit-wip.el" (22140 7080 0 0)) ;;; Generated autoloads from magit-wip.el (defvar magit-wip-after-save-mode nil "\ @@ -1324,7 +1490,7 @@ 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-process.el" "magit-section.el" "magit-utils.el") -;;;;;; (22093 56217 977843 0)) +;;;;;; (22140 7080 159081 0)) ;;;*** diff --git a/elpa/magit-20151119.202/magit-bisect.el b/elpa/magit-20151223.1425/magit-bisect.el similarity index 98% rename from elpa/magit-20151119.202/magit-bisect.el rename to elpa/magit-20151223.1425/magit-bisect.el index dfee00a5..8a7702cb 100644 --- a/elpa/magit-20151119.202/magit-bisect.el +++ b/elpa/magit-20151223.1425/magit-bisect.el @@ -1,4 +1,4 @@ -;;; magit-bisect.el --- bisect support for Magit +;;; magit-bisect.el --- bisect support for Magit -*- lexical-binding: t -*- ;; Copyright (C) 2011-2015 The Magit Project Contributors ;; @@ -172,7 +172,7 @@ bisect run'." (magit-git-wash #'magit-wash-bisect-log "bisect" "log") (insert ?\n)))) -(defun magit-wash-bisect-log (args) +(defun magit-wash-bisect-log (_args) (let (beg) (while (progn (setq beg (point-marker)) (re-search-forward "^\\(git bisect [^\n]+\n\\)" nil t)) diff --git a/elpa/magit-20151119.202/magit-blame.el b/elpa/magit-20151223.1425/magit-blame.el similarity index 98% rename from elpa/magit-20151119.202/magit-blame.el rename to elpa/magit-20151223.1425/magit-blame.el index 23c516fa..983e4dd8 100644 --- a/elpa/magit-20151119.202/magit-blame.el +++ b/elpa/magit-20151223.1425/magit-blame.el @@ -1,4 +1,4 @@ -;;; magit-blame.el --- blame support for Magit +;;; magit-blame.el --- blame support for Magit -*- lexical-binding: t -*- ;; Copyright (C) 2012-2015 The Magit Project Contributors ;; @@ -182,11 +182,12 @@ and then turned on again when turning off the latter." (when (overlay-get ov 'magit-blame) (delete-overlay ov)))))))) -(defadvice auto-revert-handler (around magit-blame activate) - "If Magit-Blame mode is on, then do nothing. -See #1731." - (unless magit-blame-mode - ad-do-it)) +(defun auto-revert-handler--unless-magit-blame-mode () + "If Magit-Blame mode is on, then do nothing. See #1731." + magit-blame-mode) + +(advice-add 'auto-revert-handler :before-until + 'auto-revert-handler--unless-magit-blame-mode) ;;;###autoload (autoload 'magit-blame-popup "magit-blame" nil t) (magit-define-popup magit-blame-popup @@ -195,8 +196,8 @@ See #1731." :man-page "git-blame" :switches '((?w "Ignore whitespace" "-w") (?r "Do not treat root commits as boundaries" "--root")) - :options '((?C "Detect lines moved or copied within a file" "-C" read-string) - (?M "Detect lines moved or copied between files" "-M" read-string)) + :options '((?C "Detect lines moved or copied within a file" "-C") + (?M "Detect lines moved or copied between files" "-M")) :actions '((?b "Blame" magit-blame)) :default-arguments '("-w") :default-action 'magit-blame) diff --git a/elpa/magit-20151119.202/magit-commit.el b/elpa/magit-20151223.1425/magit-commit.el similarity index 97% rename from elpa/magit-20151119.202/magit-commit.el rename to elpa/magit-20151223.1425/magit-commit.el index 9d72a2de..7a36c89a 100644 --- a/elpa/magit-20151119.202/magit-commit.el +++ b/elpa/magit-20151223.1425/magit-commit.el @@ -1,4 +1,4 @@ -;;; magit-commit.el --- create Git commits +;;; magit-commit.el --- create Git commits -*- lexical-binding: t -*- ;; Copyright (C) 2008-2015 The Magit Project Contributors ;; @@ -103,9 +103,9 @@ an error while using those is harder to recover from." (?n "Bypass git hooks" "--no-verify") (?s "Add Signed-off-by line" "--signoff") (?R "Claim authorship and reset author date" "--reset-author")) - :options ((?A "Override the author" "--author=" read-from-minibuffer) - (?S "Sign using gpg" "--gpg-sign=" magit-read-gpg-secret-key) - (?C "Reuse commit message" "--reuse-message=" read-from-minibuffer)) + :options ((?A "Override the author" "--author=") + (?S "Sign using gpg" "--gpg-sign=" magit-read-gpg-secret-key) + (?C "Reuse commit message" "--reuse-message=")) :actions ((?c "Commit" magit-commit) (?e "Extend" magit-commit-extend) (?f "Fixup" magit-commit-fixup) @@ -260,7 +260,7 @@ depending on the value of option `magit-commit-squash-confirm'." (substring option 2))) (when magit-commit-show-diff (let ((magit-display-buffer-noselect t)) - (magit-diff-staged)))))) + (apply #'magit-diff-staged nil (magit-diff-arguments))))))) (defun magit-commit-assert (args &optional strict) (cond @@ -314,7 +314,7 @@ depending on the value of option `magit-commit-squash-confirm'." (defvar magit-gpg-secret-key-hist nil) -(defun magit-read-gpg-secret-key (prompt &optional initial-input) +(defun magit-read-gpg-secret-key (prompt &optional _initial-input) (require 'epa) (let ((keys (--map (list (epg-sub-key-id (car (epg-key-sub-key-list it))) (-when-let (id-obj (car (epg-key-user-id-list it))) diff --git a/elpa/magit-20151119.202/magit-core.el b/elpa/magit-20151223.1425/magit-core.el similarity index 97% rename from elpa/magit-20151119.202/magit-core.el rename to elpa/magit-20151223.1425/magit-core.el index 844671b5..418fc693 100644 --- a/elpa/magit-20151119.202/magit-core.el +++ b/elpa/magit-20151223.1425/magit-core.el @@ -1,4 +1,4 @@ -;;; magit-core.el --- core functionality +;;; magit-core.el --- core functionality -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; diff --git a/elpa/magit-20151119.202/magit-diff.el b/elpa/magit-20151223.1425/magit-diff.el similarity index 96% rename from elpa/magit-20151119.202/magit-diff.el rename to elpa/magit-20151223.1425/magit-diff.el index e3f476c8..5b1e409c 100644 --- a/elpa/magit-20151119.202/magit-diff.el +++ b/elpa/magit-20151223.1425/magit-diff.el @@ -1,4 +1,4 @@ -;;; magit-diff.el --- inspect Git diffs +;;; magit-diff.el --- inspect Git diffs -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -41,6 +41,8 @@ (declare-function magit-insert-tags-header 'magit) ;; For `magit-diff-while-committing' (declare-function magit-commit-message-buffer 'magit) +;; For `magit-insert-revision-gravatar' +(defvar gravatar-size) ;; For `magit-show-commit' and `magit-diff-show-or-scroll' (declare-function magit-blame-chunk-get 'magit-blame) (declare-function magit-blame-mode 'magit-blame) @@ -437,9 +439,9 @@ and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=7847." '(:variable magit-diff-arguments :man-page "git-diff" :options ((?f "Limit to files" "-- " magit-read-files) - (?u "Context lines" "-U" read-from-minibuffer) - (?m "Detect renames" "-M" read-from-minibuffer) - (?c "Detect copies" "-C" read-from-minibuffer) + (?u "Context lines" "-U") + (?m "Detect renames" "-M") + (?c "Detect copies" "-C") (?a "Diff algorithm" "--diff-algorithm=" magit-diff-select-algorithm)))) @@ -616,20 +618,18 @@ If no DWIM context is found, nil is returned." (cons 'commit magit-buffer-refname)) ((derived-mode-p 'magit-revision-mode) (cons 'commit (car magit-refresh-args))) + ((derived-mode-p 'magit-diff-mode) + (nth 0 magit-refresh-args)) (t (magit-section-case ([* unstaged] 'unstaged) ([* staged] 'staged) - (unpushed (format "%s...%s" - (magit-get-tracked-branch) - (magit-get-current-branch))) - (unpulled (format "%s...%s" - (magit-get-current-branch) - (magit-get-tracked-branch))) + (unpushed (magit-section-value it)) + (unpulled (magit-section-value it)) (branch (let ((current (magit-get-current-branch)) (atpoint (magit-section-value it))) (if (equal atpoint current) - (--if-let (magit-get-tracked-branch) + (--if-let (magit-get-upstream-branch) (format "%s...%s" it current) (if (magit-anything-modified-p) current @@ -720,28 +720,12 @@ a commit read from the minibuffer." (interactive (magit-diff-arguments)) (magit-diff-setup nil nil args files)) -;;;###autoload -(defun magit-diff-unpushed (&optional args files) - "Show unpushed changes." - (interactive (magit-diff-arguments)) - (-if-let (tracked (magit-get-tracked-ref)) - (magit-diff-setup (concat tracked "...") nil args files) - (user-error "No upstream set"))) - -;;;###autoload -(defun magit-diff-unpulled (&optional args files) - "Show unpulled changes." - (interactive (magit-diff-arguments)) - (-if-let (tracked (magit-get-tracked-ref)) - (magit-diff-setup (concat "..." tracked) nil args files) - (user-error "No upstream set"))) - ;;;###autoload (defun magit-diff-while-committing (&optional args files) "While committing, show the changes that are about to be committed. While amending, invoking the command again toggles between showing just the new changes or all the changes that will -be commited." +be committed." (interactive (magit-diff-arguments)) (let ((toplevel (magit-toplevel)) (diff-buf (magit-mode-get-buffer 'magit-diff-mode))) @@ -775,9 +759,6 @@ be commited." nil (list (expand-file-name a) (expand-file-name b)))) -(defvar-local magit-diff-hidden-files nil) -(put 'magit-diff-hidden-files 'permanent-local t) - ;;;###autoload (defun magit-show-commit (rev &optional args files module) "Show the revision at point. @@ -785,7 +766,8 @@ If there is no revision at point or with a prefix argument prompt for a revision." (interactive (let* ((mcommit (magit-section-when module-commit)) - (atpoint (or (and magit-blame-mode (magit-blame-chunk-get :hash)) + (atpoint (or (and (bound-and-true-p magit-blame-mode) + (magit-blame-chunk-get :hash)) mcommit (magit-branch-or-commit-at-point) (magit-tag-at-point)))) @@ -794,6 +776,7 @@ for a revision." (magit-diff-arguments)) (and mcommit (list (magit-section-parent-value (magit-current-section))))))) + (require 'magit) (magit-with-toplevel (when module (setq default-directory @@ -806,11 +789,7 @@ for a revision." (unless (equal rev prev) (dolist (child (cdr (magit-section-children magit-root-section))) (when (eq (magit-section-type child) 'file) - (let ((file (magit-section-value child))) - (if (magit-section-hidden child) - (add-to-list 'magit-diff-hidden-files file) - (setq magit-diff-hidden-files - (delete file magit-diff-hidden-files)))))))))) + (magit-section-cache-visibility child))))))) (magit-mode-setup #'magit-revision-mode rev nil args files))) (defun magit-diff-refresh (args files) @@ -964,7 +943,7 @@ which, as the name suggests always visits the actual file." (and (string-match "\\.\\.\\([^.].*\\)?[ \t]*\\'" it) (match-string 1 it)))))) (unmerged-p (magit-anything-unmerged-p file)) - diff hunk line col buffer) + hunk line col buffer) (when (and rev (magit-rev-head-p rev)) (setq rev nil)) (setq hunk @@ -987,7 +966,9 @@ which, as the name suggests always visits the actual file." (when col (move-to-column col))) (when unmerged-p - (smerge-start-session))))) + (smerge-start-session)) + (with-current-buffer buffer + (run-hooks 'magit-diff-visit-file-hook))))) (defvar magit-display-file-buffer-function 'magit-display-file-buffer-traditional @@ -1124,7 +1105,7 @@ commit or stash at point, then prompt for a commit." rev) (car magit-refresh-args)))) (with-selected-window win - (condition-case err + (condition-case nil (funcall fn) (error (goto-char (pcase fn @@ -1177,7 +1158,7 @@ Staging and applying changes is documented in info node (defun magit-diff-refresh-buffer (rev-or-range const _args files) "Refresh the current `magit-diff-mode' buffer. -In such buffer the buffer-local value of `magit-refresh-args', +In such buffers the buffer-local value of `magit-refresh-args' has the same form as the arguments of this function. The value is set in `magit-mode-setup'." (setq header-line-format @@ -1213,15 +1194,15 @@ is set in `magit-mode-setup'." (let ((map (make-sparse-keymap))) (define-key map [C-return] 'magit-diff-visit-file-worktree) (define-key map "\C-j" 'magit-diff-visit-file-worktree) - (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) - (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) + (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-revert-no-commit] 'magit-reverse) (define-key map "a" 'magit-apply) (define-key map "C" 'magit-commit-add-log) (define-key map "K" 'magit-file-untrack) (define-key map "R" 'magit-file-rename) (define-key map "s" 'magit-stage) (define-key map "u" 'magit-unstage) - (define-key map "v" 'magit-reverse) map) "Keymap for `file' sections.") @@ -1229,13 +1210,13 @@ is set in `magit-mode-setup'." (let ((map (make-sparse-keymap))) (define-key map [C-return] 'magit-diff-visit-file-worktree) (define-key map "\C-j" 'magit-diff-visit-file-worktree) - (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) - (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-visit-thing] 'magit-diff-visit-file) + (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-revert-no-commit] 'magit-reverse) (define-key map "a" 'magit-apply) (define-key map "C" 'magit-commit-add-log) (define-key map "s" 'magit-stage) (define-key map "u" 'magit-unstage) - (define-key map "v" 'magit-reverse) map) "Keymap for `hunk' sections.") @@ -1344,7 +1325,7 @@ section or a child thereof." (magit-delete-line) (while (looking-at "^ \\([^ ]+\\) +[0-9]\\{6\\} \\([a-z0-9]\\{40\\}\\) \\(.+\\)$") - (magit-bind-match-strings (side blob name) nil + (magit-bind-match-strings (side _blob name) nil (pcase side ("result" (setq file name)) ("our" (setq orig name)) @@ -1507,8 +1488,13 @@ Staging and applying changes is documented in info node (defun magit-insert-revision-diff (rev) "Insert the diff into this `magit-revision-mode' buffer." - (magit-git-wash #'magit-diff-wash-diffs - "show" "-p" "--cc" "--format=" "--no-prefix" + ;; Before v2.2.0, "--format=" did not mean "no output". + ;; Instead the default format was used. So use "--format=%n" + ;; and then delete the empty lines. + (magit-git-wash (lambda (args) + (delete-region (point) (progn (forward-line 3) (point))) + (magit-diff-wash-diffs args)) + "show" "-p" "--cc" "--format=%n" "--no-prefix" (and (member "--stat" (nth 2 magit-refresh-args)) "--numstat") (nth 2 magit-refresh-args) (concat rev "^{commit}") "--" (nth 3 magit-refresh-args))) @@ -1566,8 +1552,9 @@ or a ref which is not a branch, then it inserts nothing." (defun magit-insert-revision-headers (rev) "Insert headers about the commit into a revision buffer." (magit-insert-section (headers) - (--when-let (magit-rev-format "%D" rev "--decorate=full") - (insert (magit-format-ref-labels it) ?\s)) + ;; Before v2.2.0, "%D" was not supported. + (--when-let (magit-rev-format "%d" rev "--decorate=full") + (insert (magit-format-ref-labels (substring it 2 -1)) ?\s)) (insert (propertize (magit-rev-parse (concat rev "^{commit}")) 'face 'magit-hash)) (magit-insert-heading) @@ -1662,13 +1649,6 @@ or a ref which is not a branch, then it inserts nothing." (if magit-revision-use-gravatar-kludge slice2 slice1) (if magit-revision-use-gravatar-kludge slice1 slice2))))))) -(defun magit-revision-set-visibility (section) - "Preserve section visibility when displaying another commit." - (and (derived-mode-p 'magit-revision-mode) - (eq (magit-section-type section) 'file) - (member (magit-section-value section) magit-diff-hidden-files) - 'hide)) - ;;; Diff Sections (defvar magit-unstaged-section-map @@ -1680,7 +1660,7 @@ or a ref which is not a branch, then it inserts nothing." map) "Keymap for the `unstaged' section.") -(magit-define-section-jumper unstaged "Unstaged changes") +(magit-define-section-jumper magit-jump-to-unstaged "Unstaged changes" unstaged) (defun magit-insert-unstaged-changes () "Insert section showing unstaged changes." @@ -1692,15 +1672,15 @@ or a ref which is not a branch, then it inserts nothing." (defvar magit-staged-section-map (let ((map (make-sparse-keymap))) - (define-key map [remap magit-visit-thing] 'magit-diff-staged) - (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-visit-thing] 'magit-diff-staged) + (define-key map [remap magit-delete-thing] 'magit-discard) + (define-key map [remap magit-revert-no-commit] 'magit-reverse) (define-key map "s" 'magit-stage) (define-key map "u" 'magit-unstage) - (define-key map "v" 'magit-reverse) map) "Keymap for the `staged' section.") -(magit-define-section-jumper staged "Staged changes") +(magit-define-section-jumper magit-jump-to-staged "Staged changes" staged) (defun magit-insert-staged-changes () "Insert section showing staged changes." @@ -1843,13 +1823,12 @@ are highlighted." t))) (defun magit-diff-highlight-recursive (section &optional selection) - (if (magit-section-match '(module-commit diffstat commit-header) section) - (magit-section-highlight section nil) - (pcase (magit-diff-scope section) - (`list (magit-diff-highlight-list section selection)) - (`file (magit-diff-highlight-file section selection)) - (`hunk (magit-diff-highlight-heading section selection) - (magit-diff-paint-hunk section selection t))))) + (pcase (magit-diff-scope section) + (`list (magit-diff-highlight-list section selection)) + (`file (magit-diff-highlight-file section selection)) + (`hunk (magit-diff-highlight-heading section selection) + (magit-diff-paint-hunk section selection t)) + (_ (magit-section-highlight section nil)))) (defun magit-diff-highlight-list (section &optional selection) (let ((beg (magit-section-start section)) diff --git a/elpa/magit-20151119.202/magit-ediff.el b/elpa/magit-20151223.1425/magit-ediff.el similarity index 99% rename from elpa/magit-20151119.202/magit-ediff.el rename to elpa/magit-20151223.1425/magit-ediff.el index a1766891..2fb73349 100644 --- a/elpa/magit-20151119.202/magit-ediff.el +++ b/elpa/magit-20151223.1425/magit-ediff.el @@ -1,4 +1,4 @@ -;;; magit-ediff.el --- Ediff extension for Magit +;;; magit-ediff.el --- Ediff extension for Magit -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; diff --git a/elpa/magit-20151119.202/magit-extras.el b/elpa/magit-20151223.1425/magit-extras.el similarity index 91% rename from elpa/magit-20151119.202/magit-extras.el rename to elpa/magit-20151223.1425/magit-extras.el index db23a8e6..8355901a 100644 --- a/elpa/magit-20151119.202/magit-extras.el +++ b/elpa/magit-20151223.1425/magit-extras.el @@ -1,4 +1,4 @@ -;;; magit-extras.el --- additional functionality for Magit +;;; magit-extras.el --- additional functionality for Magit -*- lexical-binding: t -*- ;; Copyright (C) 2008-2015 The Magit Project Contributors ;; @@ -118,7 +118,8 @@ with two prefix arguments remove ignored files only. (defun magit-gitignore (file-or-pattern &optional local) "Instruct Git to ignore FILE-OR-PATTERN. With a prefix argument only ignore locally." - (interactive (magit-gitignore-read-args current-prefix-arg)) + (interactive (list (magit-gitignore-read-pattern current-prefix-arg) + current-prefix-arg)) (let ((gitignore (if local (magit-git-dir (convert-standard-filename "info/exclude")) @@ -138,13 +139,12 @@ With a prefix argument only ignore locally." (magit-run-git "add" ".gitignore")))) ;;;###autoload -(defun magit-gitignore-locally (file-or-pattern &optional local) - "Instruct Git to locally ignore FILE-OR-PATTERN. -\n(fn FILE-OR-PATTERN)" - (interactive (magit-gitignore-read-args t)) +(defun magit-gitignore-locally (file-or-pattern) + "Instruct Git to locally ignore FILE-OR-PATTERN." + (interactive (list (magit-gitignore-read-pattern t))) (magit-gitignore file-or-pattern t)) -(defun magit-gitignore-read-args (local) +(defun magit-gitignore-read-pattern (local) (let* ((default (magit-current-file)) (choices (delete-dups @@ -160,10 +160,9 @@ With a prefix argument only ignore locally." (setq default (concat "*." (file-name-extension default))) (unless (member default choices) (setq default nil)))) - (list (magit-completing-read - (concat "File or pattern to ignore" (and local " locally")) - choices nil nil nil nil default) - local))) + (magit-completing-read (concat "File or pattern to ignore" + (and local " locally")) + choices nil nil nil nil default))) ;;; ChangeLog diff --git a/elpa/magit-20151119.202/magit-git.el b/elpa/magit-20151223.1425/magit-git.el similarity index 86% rename from elpa/magit-20151119.202/magit-git.el rename to elpa/magit-20151223.1425/magit-git.el index dfdd6583..f8274699 100644 --- a/elpa/magit-20151119.202/magit-git.el +++ b/elpa/magit-20151223.1425/magit-git.el @@ -1,4 +1,4 @@ -;;; magit-git.el --- Git functionality +;;; magit-git.el --- Git functionality -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -38,6 +38,7 @@ (declare-function magit-process-insert-section 'magit-process) (defvar magit-process-error-message-re) (defvar magit-refresh-args) ; from `magit-mode' for `magit-current-file' +(defvar magit-branch-prefer-remote-upstream) (defvar magit-tramp-process-environment nil) @@ -300,21 +301,22 @@ call function WASHER with no argument." ;;; Files +(defun magit--safe-default-directory (&optional file) + (catch 'unsafe-default-dir + (let ((dir (file-name-as-directory + (expand-file-name (or file default-directory)))) + (previous nil)) + (while (not (file-accessible-directory-p dir)) + (setq dir (file-name-directory (directory-file-name dir))) + (when (equal dir previous) + (throw 'unsafe-default-dir nil)) + (setq previous dir)) + dir))) + (defmacro magit--with-safe-default-directory (file &rest body) (declare (indent 1) (debug (form body))) - `(catch 'unsafe-default-dir - (let ((default-directory (file-name-as-directory - (expand-file-name - (or ,file default-directory)))) - previous) - (while (not (file-accessible-directory-p default-directory)) - (setq default-directory - (file-name-directory - (directory-file-name default-directory))) - (when (equal default-directory previous) - (throw 'unsafe-default-dir nil)) - (setq previous default-directory)) - ,@body))) + `(-when-let (default-directory (magit--safe-default-directory ,file)) + ,@body)) (defun magit-git-dir (&optional path) "Return absolute path to the control directory of the current repository. @@ -452,8 +454,9 @@ tracked file." (setq file (or magit-buffer-file-name buffer-file-name)))) (when (and file (or (not tracked) (magit-file-tracked-p (file-relative-name file)))) - (--when-let (magit-toplevel (magit--with-safe-default-directory file - default-directory)) + (--when-let (magit-toplevel + (magit--safe-default-directory + (directory-file-name (file-name-directory file)))) (file-relative-name file it)))) (defun magit-file-tracked-p (file) @@ -472,10 +475,15 @@ tracked file." (magit-git-items "diff-files" "-z" "--name-only" (and nomodules "--ignore-submodules"))) -(defun magit-staged-files (&optional nomodules) +(defun magit-staged-files (&optional nomodules files) (magit-git-items "diff-index" "-z" "--name-only" "--cached" (and nomodules "--ignore-submodules") - (magit-headish))) + (magit-headish) "--" files)) + +(defun magit-unstaged-files (&optional nomodules files) + (magit-git-items "diff-index" "-z" "--name-only" + (and nomodules "--ignore-submodules") + (magit-headish) "--" files)) (defun magit-staged-binary-files () (--mapcat (and (string-match "^-\t-\t\\(.+\\)" it) @@ -531,7 +539,7 @@ range. Otherwise, it can be any revision or range accepted by (lwarn '(magit) :error "Failed to parse Cygwin mount: %S" it)) (ignore-errors (process-lines "mount"))) - #'> :key (-lambda ((cyg . win)) (length cyg)))) + #'> :key (-lambda ((cyg . _win)) (length cyg)))) "Alist of (CYGWIN . WIN32) directory names. Sorted from longest to shortest CYGWIN name." :package-version '(magit . "2.3.0") @@ -634,6 +642,10 @@ string \"true\", otherwise return nil." (defun magit-rev-equal (a b) (magit-git-success "diff" "--quiet" a b)) +(defun magit-rev-ancestor-p (a b) + "Return non-nil if commit A is an ancestor of commit B." + (magit-git-success "merge-base" "--is-ancestor" a b)) + (defun magit-rev-head-p (rev) (or (equal rev "HEAD") (and rev @@ -661,6 +673,29 @@ string \"true\", otherwise return nil." (match-string 1 rev) rev))) +(defun magit-name-branch (rev &optional lax) + (or (magit-name-local-branch rev) + (magit-name-remote-branch rev) + (and lax (or (magit-name-local-branch rev t) + (magit-name-remote-branch rev t))))) + +(defun magit-name-local-branch (rev &optional lax) + (--when-let (magit-git-string "name-rev" "--name-only" "--no-undefined" + "--refs=refs/heads/*" rev) + (and (or lax (not (string-match-p "~" it))) it))) + +(defun magit-name-remote-branch (rev &optional lax) + (--when-let (magit-git-string "name-rev" "--name-only" "--no-undefined" + "--refs=refs/remotes/*" rev) + (and (or lax (not (string-match-p "~" it))) + (substring it 8)))) + +(defun magit-name-tag (rev &optional lax) + (--when-let (magit-git-string "name-rev" "--name-only" "--no-undefined" + "--refs=refs/tags/*" rev) + (and (or lax (not (string-match-p "~" it))) + (substring it 5)))) + (defun magit-ref-fullname (name) (magit-rev-parse "--symbolic-full-name" name)) @@ -674,13 +709,23 @@ string \"true\", otherwise return nil." "HEAD")) (defun magit-branch-at-point () - (magit-section-when branch)) + (magit-section-case + (branch (magit-section-value it)) + (commit (magit-name-branch (magit-section-value it))))) (defun magit-local-branch-at-point () - (magit-section-when branch - (let ((branch (magit-section-value it))) - (when (member branch (magit-list-local-branch-names)) - branch)))) + (magit-section-case + (branch (let ((branch (magit-section-value it))) + (when (member branch (magit-list-local-branch-names)) + branch))) + (commit (magit-name-local-branch (magit-section-value it))))) + +(defun magit-remote-branch-at-point () + (magit-section-case + (branch (let ((branch (magit-section-value it))) + (when (member branch (magit-list-remote-branch-names)) + branch))) + (commit (magit-name-remote-branch (magit-section-value it))))) (defun magit-commit-at-point () (or (magit-section-when commit) @@ -690,13 +735,15 @@ string \"true\", otherwise return nil." (defun magit-branch-or-commit-at-point () (or (magit-section-case (branch (magit-section-value it)) - (commit (magit-get-shortname (magit-section-value it)))) + (commit (let ((rev (magit-section-value it))) + (or (magit-get-shortname rev) rev)))) (and (derived-mode-p 'magit-revision-mode) (car magit-refresh-args)))) - (defun magit-tag-at-point () - (magit-section-when tag)) + (magit-section-case + (tag (magit-section-value it)) + (commit (magit-name-tag (magit-section-value it))))) (defun magit-stash-at-point () (magit-section-when stash)) @@ -723,7 +770,7 @@ which is different from the current branch and still exists." (cl-incf i)) prev)) -(cl-defun magit-get-tracked-ref +(cl-defun magit-get-upstream-ref (&optional (branch (magit-get-current-branch))) (when branch (let ((remote (magit-get "branch" branch "remote")) @@ -733,7 +780,7 @@ which is different from the current branch and still exists." ((string-prefix-p "refs/heads/" merge) (concat "refs/remotes/" remote "/" (substring merge 11)))))))) -(cl-defun magit-get-tracked-branch +(cl-defun magit-get-upstream-branch (&optional (branch (magit-get-current-branch))) (when branch (let ((remote (magit-get "branch" branch "remote")) @@ -741,15 +788,44 @@ which is different from the current branch and still exists." (when (and remote merge (string-prefix-p "refs/heads/" merge)) (setq merge (substring merge 11)) (if (string-equal remote ".") - merge - (concat remote "/" merge)))))) + (propertize merge 'face 'magit-branch-local) + (propertize (concat remote "/" merge) 'face 'magit-branch-remote)))))) + +(defun magit-get-indirect-upstream-branch (branch &optional force) + (let ((remote (magit-get "branch" branch "remote"))) + (and remote (not (equal remote ".")) + ;; The user has opted in... + (or force (member branch magit-branch-prefer-remote-upstream)) + ;; and local BRANCH tracks a remote branch... + (let ((upstream (magit-get-upstream-branch branch))) + ;; whose upstream... + (and upstream + ;; has the same name as BRANCH and... + (equal (substring upstream (1+ (length remote))) branch) + ;; and can be fast-forwarded to BRANCH. + (magit-rev-ancestor-p upstream branch) + upstream))))) + +(cl-defun magit-get-upstream-remote + (&optional (branch (magit-get-current-branch))) + (when branch + (magit-get "branch" branch "remote"))) + +(cl-defun magit-get-push-remote + (&optional (branch (magit-get-current-branch))) + (or (and branch (magit-get "branch" branch "pushRemote")) + (magit-get "remote.pushDefault"))) (cl-defun magit-get-push-branch (&optional (branch (magit-get-current-branch))) - (when branch - (-when-let (remote (or (magit-get "branch" branch "pushRemote") - (magit-get "remote.pushDefault"))) - (concat remote "/" branch)))) + (-when-let (remote (and branch (magit-get-push-remote branch))) + (concat remote "/" branch))) + +(defun magit-get-@{push}-branch (&optional branch) + (let ((ref (magit-rev-parse "--symbolic-full-name" + (concat branch "@{push}")))) + (when (and ref (string-prefix-p "refs/remotes/" ref)) + (substring ref 13)))) (defun magit-get-remote (&optional branch) (when (or branch (setq branch (magit-get-current-branch))) @@ -757,12 +833,14 @@ which is different from the current branch and still exists." (unless (equal remote ".") remote)))) -(defun magit-get-remote-branch (&optional branch) - (-when-let (local (or branch (magit-get-current-branch))) - (let ((remote (magit-get-remote local)) - (branch (magit-get "branch" local "merge"))) - (when (and remote branch (string-match "^refs/heads/\\(.+\\)" branch)) - (cons remote (match-string 1 branch)))))) +(defun magit-split-branch-name (branch) + (cond ((member branch (magit-list-local-branch-names)) + (cons "." branch)) + ((string-match "/" branch) + (let ((remote (substring branch 0 (match-beginning 0)))) + (if (save-match-data (member remote (magit-list-remotes))) + (cons remote (substring branch (match-end 0))) + (error "Invalid branch name %s" branch)))))) (defun magit-get-current-tag (&optional rev with-distance) "Return the closest tag reachable from REV. @@ -817,16 +895,22 @@ where COMMITS is the number of commits in TAG but not in REV." (magit-list-refs (concat "refs/remotes/" remote))) (defun magit-list-containing-branches (&optional commit) - (--map (substring it 2) (magit-git-lines "branch" "--contains" commit))) + (--filter (not (string-match-p "\\`(HEAD" it)) + (--map (substring it 2) + (magit-git-lines "branch" "--contains" commit)))) (defun magit-list-merged-branches (&optional commit) - (--map (substring it 2) (magit-git-lines "branch" "--merged" commit))) + (--filter (not (string-match-p "\\`(HEAD" it)) + (--map (substring it 2) + (magit-git-lines "branch" "--merged" commit)))) (defun magit-list-unmerged-branches (&optional commit) - (--map (substring it 2) (magit-git-lines "branch" "--no-merged" commit))) + (--filter (not (string-match-p "\\`(HEAD" it)) + (--map (substring it 2) + (magit-git-lines "branch" "--no-merged" commit)))) (defun magit-list-unmerged-to-upstream-branches () - (--filter (-when-let (upstream (magit-get-tracked-branch it)) + (--filter (-when-let (upstream (magit-get-upstream-branch it)) (member it (magit-list-unmerged-branches upstream))) (magit-list-local-branch-names))) @@ -865,11 +949,16 @@ where COMMITS is the number of commits in TAG but not in REV." (defun magit-list-notes-refnames () (--map (substring it 6) (magit-list-refnames "refs/notes"))) -(defun magit-list-remote-tags (remote) +(defun magit-remote-list-tags (remote) (--map (substring it 51) (--filter (not (string-match-p "\\^{}$" it)) (magit-git-lines "ls-remote" "--tags" remote)))) +(defun magit-remote-list-branches (remote) + (--map (substring it 52) + (--filter (not (string-match-p "\\^{}$" it)) + (magit-git-lines "ls-remote" "--heads" remote)))) + (defun magit-get-submodules () (--mapcat (and (string-match "^160000 [0-9a-z]\\{40\\} 0\t\\(.+\\)$" it) (list (match-string 1 it))) @@ -879,6 +968,15 @@ where COMMITS is the number of commits in TAG but not in REV." (and (or (member string (magit-list-branches)) (member string (magit-list-branch-names))) t)) +(defun magit-local-branch-p (branch) + (and (or (member branch (magit-list-local-branches)) + (member branch (magit-list-local-branch-names))) t)) + +(defun magit-branch-set-face (branch) + (propertize branch 'face (if (magit-local-branch-p branch) + 'magit-branch-local + 'magit-branch-remote))) + (defun magit-remote-p (string) (car (member string (magit-list-remotes)))) @@ -952,7 +1050,8 @@ Return a list of two integers: (A>B B>A)." it)) (defun magit-format-ref-label (ref &optional head) - (-let [(re face fn) (--first (string-match (car it) ref) magit-ref-namespaces)] + (-let [(_re face fn) + (--first (string-match (car it) ref) magit-ref-namespaces)] (if fn (funcall fn ref face) (propertize (or (match-string 1 ref) ref) @@ -1081,9 +1180,7 @@ Return a list of two integers: (A>B B>A)." (defun magit-read-remote-branch (prompt &optional remote default local-branch require-match) - (when (consp default) - (setq default (concat (car default) "/" (cdr default)))) - (let ((branch (magit-completing-read + (let ((choice (magit-completing-read prompt (nconc (and local-branch (if remote @@ -1092,22 +1189,31 @@ 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))) - (string-match "^\\([^/]+\\)/\\(.+\\)" branch) - (cons (match-string 1 branch) - (match-string 2 branch)))) + (if (string-match "\\`\\([^/]+\\)/\\(.+\\)" choice) + choice + (user-error "`%s' doesn't have the form REMOTE/BRANCH" choice)))) (defun magit-read-local-branch (prompt &optional secondary-default) (magit-completing-read prompt (magit-list-local-branch-names) nil t nil 'magit-revision-history - (or (magit-branch-at-point) + (or (magit-local-branch-at-point) secondary-default (magit-get-current-branch)))) +(defun magit-read-local-branch-or-commit (prompt) + (let ((branches (magit-list-local-branch-names)) + (commit (magit-commit-at-point))) + (or (magit-completing-read prompt + (if commit (cons commit branches) branches) + nil nil nil 'magit-revision-history + (or (magit-local-branch-at-point) commit)) + (user-error "Nothing selected")))) + (defun magit-read-local-branch-or-ref (prompt &optional secondary-default) (magit-completing-read prompt (nconc (magit-list-local-branch-names) (magit-list-refs "refs/")) nil t nil 'magit-revision-history - (or (magit-branch-at-point) + (or (magit-local-branch-at-point) secondary-default (magit-get-current-branch)))) @@ -1177,6 +1283,14 @@ Return a list of two integers: (A>B B>A)." (magit-git-string "config" "--unset" (mapconcat 'identity keys ".")))) ;;; magit-git.el ends soon + +(define-obsolete-function-alias 'magit-get-tracked-ref + 'magit-get-upstream-ref "Magit 2.4.0") +(define-obsolete-function-alias 'magit-get-tracked-branch + 'magit-get-upstream-branch "Magit 2.4.0") +(define-obsolete-function-alias 'magit-get-tracked-remote + 'magit-get-upstream-remote "Magit 2.4.0") + (provide 'magit-git) ;; Local Variables: ;; indent-tabs-mode: nil diff --git a/elpa/magit-20151119.202/magit-log.el b/elpa/magit-20151223.1425/magit-log.el similarity index 91% rename from elpa/magit-20151119.202/magit-log.el rename to elpa/magit-20151223.1425/magit-log.el index 5023129e..72397c68 100644 --- a/elpa/magit-20151119.202/magit-log.el +++ b/elpa/magit-20151223.1425/magit-log.el @@ -1,4 +1,4 @@ -;;; magit-log.el --- inspect Git history +;;; magit-log.el --- inspect Git history -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -36,7 +36,7 @@ (declare-function magit-blob-visit 'magit) (declare-function magit-find-file-noselect 'magit) (declare-function magit-insert-head-branch-header 'magit) -(declare-function magit-insert-pull-branch-header 'magit) +(declare-function magit-insert-upstream-branch-header 'magit) (declare-function magit-read-file-from-rev 'magit) (declare-function magit-show-commit 'magit) (defvar magit-refs-indent-cherry-lines) @@ -291,13 +291,13 @@ are no unpulled commits) show." (?h "Show header" "++header") (?D "Simplify by decoration" "--simplify-by-decoration") (?f "Follow renames when showing single-file log" "--follow")) - :options ((?n "Limit number of commits" "-n" read-from-minibuffer) - (?f "Limit to files" "-- " magit-read-files) - (?a "Limit to author" "--author=" read-from-minibuffer) - (?g "Search messages" "--grep=" read-from-minibuffer) - (?G "Search changes" "-G" read-from-minibuffer) - (?S "Search occurences" "-S" read-from-minibuffer) - (?L "Trace line evolution" "-L" magit-read-file-trace)) + :options ((?n "Limit number of commits" "-n") + (?f "Limit to files" "-- " magit-read-files) + (?a "Limit to author" "--author=") + (?g "Search messages" "--grep=") + (?G "Search changes" "-G") + (?S "Search occurences" "-S") + (?L "Trace line evolution" "-L" magit-read-file-trace)) :actions ((?l "Log current" magit-log-current) (?L "Log local branches" magit-log-branches) (?r "Reflog current" magit-reflog-current) @@ -321,13 +321,13 @@ are no unpulled commits) show." (?s "Show diffstats" "--stat") (?D "Simplify by decoration" "--simplify-by-decoration") (?f "Follow renames when showing single-file log" "--follow")) - :options ((?n "Limit number of commits" "-n" read-from-minibuffer) - (?f "Limit to files" "-- " magit-read-files) - (?a "Limit to author" "--author=" read-from-minibuffer) - (?g "Search messages" "--grep=" read-from-minibuffer) - (?G "Search changes" "-G" read-from-minibuffer) - (?S "Search occurences" "-S" read-from-minibuffer) - (?L "Trace line evolution" "-L" magit-read-file-trace)) + :options ((?n "Limit number of commits" "-n") + (?f "Limit to files" "-- " magit-read-files) + (?a "Limit to author" "--author=") + (?g "Search messages" "--grep=") + (?G "Search changes" "-G") + (?S "Search occurences" "-S") + (?L "Trace line evolution" "-L" magit-read-file-trace)) :actions ((?g "Refresh" magit-log-refresh) (?t "Toggle margin" magit-toggle-margin) (?s "Set defaults" magit-log-set-default-arguments) nil @@ -337,7 +337,7 @@ are no unpulled commits) show." (defvar magit-reflog-mode-refresh-popup '(:variable magit-reflog-arguments :man-page "git-reflog" - :options ((?n "Limit number of commits" "-n" read-from-minibuffer)))) + :options ((?n "Limit number of commits" "-n")))) (defvar magit-log-refresh-popup '(:variable magit-log-arguments @@ -740,7 +740,6 @@ Do not add this to a hook variable." (let ((map (make-sparse-keymap))) (define-key map [remap magit-visit-thing] 'magit-show-commit) (define-key map "a" 'magit-cherry-apply) - (define-key map "v" 'magit-revert-no-commit) map) "Keymap for `commit' sections.") @@ -827,7 +826,7 @@ Do not add this to a hook variable." (format "Type \\<%s>\\[%s] to show more history" 'magit-log-mode-map 'magit-log-double-commit-limit)) - 'action (lambda (button) + 'action (lambda (_button) (magit-log-double-commit-limit)) 'follow-link t 'mouse-face 'magit-section-highlight))) @@ -884,8 +883,7 @@ Do not add this to a hook variable." (pcase (and gpg (aref gpg 0)) (?G 'magit-signature-good) (?B 'magit-signature-bad) - (?U 'magit-signature-untrusted)))) - (insert ?\s)) + (?U 'magit-signature-untrusted))))) (when (and refs magit-log-show-refname-after-summary) (insert ?\s) (insert (magit-format-ref-labels refs))) @@ -1164,7 +1162,7 @@ Type \\[magit-cherry-pick-popup] to apply the commit at point. (interactive (let ((head (magit-read-branch "Cherry head"))) (list head (magit-read-other-branch "Cherry upstream" head - (magit-get-tracked-branch head))))) + (magit-get-upstream-branch head))))) (magit-mode-setup #'magit-cherry-mode upstream head)) (defun magit-cherry-refresh-buffer (_upstream _head) @@ -1174,9 +1172,9 @@ Type \\[magit-cherry-pick-popup] to apply the commit at point. (defun magit-insert-cherry-headers () "Insert headers appropriate for `magit-cherry-mode' buffers." (magit-insert-head-branch-header (nth 1 magit-refresh-args)) - (magit-insert-pull-branch-header (nth 1 magit-refresh-args) - (nth 0 magit-refresh-args) - "Upstream: ") + (magit-insert-upstream-branch-header (nth 1 magit-refresh-args) + (nth 0 magit-refresh-args) + "Upstream: ") (insert ?\n)) (defun magit-insert-cherry-commits () @@ -1257,49 +1255,87 @@ Type \\[magit-reset] to reset HEAD to the commit at point. (defvar magit-unpulled-section-map (let ((map (make-sparse-keymap))) - (define-key map [remap magit-visit-thing] 'magit-diff-unpulled) + (define-key map [remap magit-visit-thing] 'magit-diff-dwim) map) - "Keymap for the `unpulled' section.") - -(magit-define-section-jumper unpulled "Unpulled commits") - -(defun magit-insert-unpulled-commits () - "Insert section showing unpulled commits." - (-when-let (tracked (magit-get-tracked-ref)) - (magit-insert-section (unpulled) - (magit-insert-heading "Unpulled commits:") - (magit-insert-log (concat "HEAD.." tracked) - magit-log-section-arguments)))) + "Keymap for `unpulled' sections.") + +(magit-define-section-jumper magit-jump-to-unpulled-from-upstream + "Unpulled from @{upstream}" unpulled "..@{upstream}") + +(defun magit-insert-unpulled-from-upstream () + "Insert commits that haven't been pulled from the upstream yet." + (when (magit-git-success "rev-parse" "@{upstream}") + (magit-insert-section (unpulled "..@{upstream}") + (magit-insert-heading + (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) + (magit-get-upstream-branch))) + (magit-insert-log "..@{upstream}" magit-log-section-arguments) + (magit-section-cache-visibility)))) + +(magit-define-section-jumper magit-jump-to-unpulled-from-pushremote + "Unpulled from " unpulled + (concat ".." (magit-get-push-branch))) + +(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}")) + (magit-insert-section (unpulled (concat ".." it)) + (magit-insert-heading + (format (propertize "Unpulled from %s:" 'face 'magit-section-heading) + (propertize it 'face 'magit-branch-remote))) + (magit-insert-log (concat ".." it) magit-log-section-arguments) + (magit-section-cache-visibility))))) (defvar magit-unpushed-section-map (let ((map (make-sparse-keymap))) - (define-key map [remap magit-visit-thing] 'magit-diff-unpushed) + (define-key map [remap magit-visit-thing] 'magit-diff-dwim) map) - "Keymap for the `unpushed' section.") - -(magit-define-section-jumper unpushed "Unpushed commits") - -(defun magit-insert-unpushed-commits () - "Insert section showing unpushed commits." - (-when-let (tracked (magit-get-tracked-ref)) - (magit-insert-section (unpushed) - (magit-insert-heading "Unpushed commits:") - (magit-insert-log (concat tracked "..HEAD") - magit-log-section-arguments)))) + "Keymap for `unpushed' sections.") + +(magit-define-section-jumper magit-jump-to-unpushed-to-upstream + "Unpushed to @{upstream}" unpushed "@{upstream}..") + +(defun magit-insert-unpushed-to-upstream () + "Insert commits that haven't been pushed to the upstream yet." + (when (magit-git-success "rev-parse" "@{upstream}") + (magit-insert-section (unpushed "@{upstream}..") + (magit-insert-heading + (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) + (magit-get-upstream-branch))) + (magit-insert-log "@{upstream}.." magit-log-section-arguments) + (magit-section-cache-visibility)))) + +(magit-define-section-jumper magit-jump-to-unpushed-to-pushremote + "Unpushed to " unpushed + (concat (magit-get-push-branch) "..")) + +(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}")) + (magit-insert-section (unpushed (concat it "..")) + (magit-insert-heading + (format (propertize "Unpushed to %s:" 'face 'magit-section-heading) + (propertize it 'face 'magit-branch-remote))) + (magit-insert-log (concat it "..") magit-log-section-arguments) + (magit-section-cache-visibility))))) ;;;; Auxiliary Log Sections (defun magit-insert-recent-commits (&optional collapse) "Insert section showing recent commits. Show the last `magit-log-section-commit-count' commits." - (magit-insert-section (recent nil collapse) - (magit-insert-heading "Recent commits:") - (magit-insert-log - (let ((beg (format "HEAD~%s" magit-log-section-commit-count))) - (and (magit-rev-verify beg) - (concat beg "..HEAD"))) - (cons (format "-%d" magit-log-section-commit-count) - magit-log-section-arguments)))) + (let* ((start (format "HEAD~%s" magit-log-section-commit-count)) + (range (and (magit-rev-verify start) + (concat start "..HEAD")))) + (magit-insert-section (recent range collapse) + (magit-insert-heading "Recent commits:") + (magit-insert-log range + (cons (format "-%d" magit-log-section-commit-count) + magit-log-section-arguments))))) (defun magit-insert-unpulled-or-recent-commits () "Insert section showing unpulled or recent commits. @@ -1307,35 +1343,35 @@ If an upstream is configured for the current branch and it is ahead of the current branch, then show the missing commits, otherwise show the last `magit-log-section-commit-count' commits." - (let ((tracked (magit-get-tracked-ref))) - (if (and tracked (not (equal (magit-rev-parse "HEAD") - (magit-rev-parse tracked)))) - (magit-insert-unpulled-commits) - (magit-insert-recent-commits t)))) + (if (equal (magit-rev-parse "HEAD") + (magit-rev-parse "@{upstream}")) + (magit-insert-recent-commits t) + (magit-insert-unpulled-from-pushremote))) (defun magit-insert-unpulled-cherries () "Insert section showing unpulled commits. -Like `magit-insert-unpulled-commits' but prefix each commit +Like `magit-insert-unpulled-to-upstream' but prefix each commit which has not been applied yet (i.e. a commit with a patch-id -not shared with any local commit) with \"+\", and all others -with \"-\"." - (-when-let (tracked (magit-get-tracked-ref)) - (magit-insert-section (unpulled) +not shared with any local commit) with \"+\", and all others with +\"-\"." + (when (magit-git-success "rev-parse" "@{upstream}") + (magit-insert-section (unpulled "..@{upstream}") (magit-insert-heading "Unpulled commits:") (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry) - "cherry" "-v" (magit-abbrev-arg) (magit-get-current-branch) tracked)))) + "cherry" "-v" (magit-abbrev-arg) + (magit-get-current-branch) "@{upstream}")))) (defun magit-insert-unpushed-cherries () "Insert section showing unpushed commits. -Like `magit-insert-unpushed-commits' but prefix each commit +Like `magit-insert-unpushed-to-upstream' but prefix each commit which has not been applied to upstream yet (i.e. a commit with a patch-id not shared with any upstream commit) with \"+\", and all others with \"-\"." - (-when-let (tracked (magit-get-tracked-ref)) - (magit-insert-section (unpushed) + (when (magit-git-success "rev-parse" "@{upstream}") + (magit-insert-section (unpushed "@{upstream}..") (magit-insert-heading "Unpushed commits:") (magit-git-wash (apply-partially 'magit-log-wash-log 'cherry) - "cherry" "-v" (magit-abbrev-arg) tracked)))) + "cherry" "-v" (magit-abbrev-arg) "@{upstream}")))) ;;;; Submodule Sections @@ -1359,7 +1395,7 @@ These sections can be expanded to show the respective commits." (dolist (module modules) (let ((default-directory (expand-file-name (file-name-as-directory module)))) - (-when-let (tracked (magit-get-tracked-ref)) + (-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) ":")) @@ -1379,7 +1415,7 @@ These sections can be expanded to show the respective commits." (dolist (module modules) (let ((default-directory (expand-file-name (file-name-as-directory module)))) - (-when-let (tracked (magit-get-tracked-ref)) + (-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) ":")) diff --git a/elpa/magit-20151119.202/magit-mode.el b/elpa/magit-20151223.1425/magit-mode.el similarity index 97% rename from elpa/magit-20151119.202/magit-mode.el rename to elpa/magit-20151223.1425/magit-mode.el index 37ccc166..158e953f 100644 --- a/elpa/magit-20151119.202/magit-mode.el +++ b/elpa/magit-20151223.1425/magit-mode.el @@ -1,4 +1,4 @@ -;;; magit-mode.el --- create and refresh Magit buffers +;;; magit-mode.el --- create and refresh Magit buffers -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -184,7 +184,7 @@ displayed. Otherwise fall back to regular region highlighting." (setq magit-revert-buffers-timer (and (boundp 'magit-revert-buffers) (numberp magit-revert-buffers) - (run-with-timer 0 magit-revert-buffers + (run-with-timer 0 (abs magit-revert-buffers) 'magit-revert-buffers-async)))) (defcustom magit-revert-buffers 'usage @@ -208,15 +208,16 @@ the current repository may optionally be reverted. what is right for them. `silent' Revert the buffers synchronously and be quiet about it. - This is the recommended setting, because for the other - values the revert messages might prevent you from - seeing other, more important, messages in the echo - area. - -NUMBER An integer or float. Revert the buffers asynchronously, - mentioning each one as it is being reverted. If user - input arrives, then stop reverting. After NUMBER - seconds resume reverting." + This (or a negative number) is the recommended setting, + because for the other values the revert messages might + prevent you from seeing other, more important, messages + in the echo area. + +NUMBER An integer or float. Revert the buffers asynchronously. + If NUMBER is positive, then mention each buffer as it is + being reverted. If it is negative, then be quiet about + it. If user input arrives, then stop reverting. After + (the absolute value of) NUMBER seconds resume reverting." :package-version '(magit . "2.1.0") :group 'magit :type '(choice @@ -306,7 +307,7 @@ It should be clear by now that we consider it a mistake to set this to display the region when the Magit selection is also visualized, but since it has been requested a few times and because it doesn't cost much to offer this option we do so. -However that might change. If the existance of this option +However that might change. If the existence of this option starts complicating other things, then it will be removed." :package-version '(magit . "2.3.0") :group 'magit-modes @@ -321,6 +322,7 @@ starts complicating other things, then it will be removed." (define-key map [C-tab] 'magit-section-cycle) (define-key map [M-tab] 'magit-section-cycle-diffs) (define-key map [s-tab] 'magit-section-cycle-global) + (define-key map [backtab] 'magit-section-cycle-global) (define-key map "^" 'magit-section-up) (define-key map "n" 'magit-section-forward) (define-key map "p" 'magit-section-backward) @@ -896,7 +898,9 @@ When called interactively then the revert is forced." (progn (message "Reverting %s inhibited due to magit-blame-mode" buffer-file-name) (run-hooks 'magit-not-reverted-hook)) - (if (eq magit-revert-buffers 'silent) + (if (or (eq magit-revert-buffers 'silent) + (and (numberp magit-revert-buffers) + (< magit-revert-buffers 0))) (revert-buffer 'ignore-auto t t) (message "Reverting buffer `%s'..." (buffer-name)) (revert-buffer 'ignore-auto t t) diff --git a/elpa/magit-20151119.202/magit-pkg.el b/elpa/magit-20151223.1425/magit-pkg.el similarity index 71% rename from elpa/magit-20151119.202/magit-pkg.el rename to elpa/magit-20151223.1425/magit-pkg.el index 8d00af1d..0c7e4c8e 100644 --- a/elpa/magit-20151119.202/magit-pkg.el +++ b/elpa/magit-20151223.1425/magit-pkg.el @@ -1,10 +1,10 @@ -(define-package "magit" "20151119.202" "A Git porcelain inside Emacs" +(define-package "magit" "20151223.1425" "A Git porcelain inside Emacs" '((emacs "24.4") (async "20150909.2257") (dash "20151021.113") (with-editor "20151111") (git-commit "20151111") - (magit-popup "20151111")) + (magit-popup "20151221")) :url "https://github.com/magit/magit" :keywords '("git" "tools" "vc")) ;; Local Variables: diff --git a/elpa/magit-20151119.202/magit-process.el b/elpa/magit-20151223.1425/magit-process.el similarity index 95% rename from elpa/magit-20151119.202/magit-process.el rename to elpa/magit-20151223.1425/magit-process.el index 1d6495df..fddb3bf9 100644 --- a/elpa/magit-20151119.202/magit-process.el +++ b/elpa/magit-20151223.1425/magit-process.el @@ -1,4 +1,4 @@ -;;; magit-process.el --- process functionality +;;; magit-process.el --- process functionality -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -384,7 +384,9 @@ repository are reverted if `magit-revert-buffers' is non-nil. See `magit-start-process' for more information." (message "Running %s %s" magit-git-executable - (mapconcat 'identity (-flatten args) " ")) + (let ((m (mapconcat #'identity (-flatten args) " "))) + (remove-list-of-text-properties 0 (length m) '(face) m) + m)) (magit-start-git nil args)) (defun magit-run-git-async-no-revert (&rest args) @@ -681,7 +683,8 @@ tracked in the current repository are reverted if "Use `auth-source-search' to get a password. If found, return the password. Otherwise, return nil." (require 'auth-source) - (let ((secret (plist-get (car (auth-source-search :max 1 :host key)) + (let ((secret (plist-get (car (auth-source-search :max 1 :host key + :require '(:host))) :secret))) (if (functionp secret) (funcall secret) @@ -741,7 +744,7 @@ as argument." (and (string= comm "git-credential-cache--daemon") (string= user user-login-name))) (list-system-processes)) - (condition-case err + (condition-case nil (start-process "git-credential-cache--daemon" " *git-credential-cache--daemon*" magit-git-executable @@ -760,21 +763,28 @@ as argument." (eq (process-status magit-this-process) 'run)) (sit-for 0.1 t))) -(defadvice tramp-sh-handle-start-file-process - (before magit-tramp-process-environment activate) - (when magit-tramp-process-environment - (ad-set-args 3 (append (cdr magit-tramp-process-environment) - (cons (ad-get-arg 2) - (ad-get-args 3)))) - (ad-set-arg 2 (car magit-tramp-process-environment)))) - -(defadvice tramp-sh-handle-process-file - (before magit-tramp-process-environment activate) - (when magit-tramp-process-environment - (ad-set-args 4 (append magit-tramp-process-environment - (cons (ad-get-arg 0) - (ad-get-args 4)))) - (ad-set-arg 0 "env"))) +(defun tramp-sh-handle-start-file-process--magit-tramp-process-environment + (fn name buffer program &rest args) + (if magit-tramp-process-environment + (apply fn name buffer + (car magit-tramp-process-environment) + (append (cdr magit-tramp-process-environment) + (cons program args))) + (apply fn name buffer program args))) + +(advice-add 'tramp-sh-handle-start-file-process :around + 'tramp-sh-handle-start-file-process--magit-tramp-process-environment) + +(defun tramp-sh-handle-process-file--magit-tramp-process-environment + (fn program &optional infile destination display &rest args) + (if magit-tramp-process-environment + (apply fn "env" infile destination display + (append magit-tramp-process-environment + (cons program args))) + (apply fn program infile destination display args))) + +(advice-add 'tramp-sh-handle-process-file :around + 'tramp-sh-handle-process-file--magit-tramp-process-environment) (defun magit-process-set-mode-line (program args) (when (equal program magit-git-executable) @@ -792,6 +802,8 @@ as argument." (define-error 'magit-git-error "Git error") +(defvar-local magit-this-error nil) + (defun magit-process-finish (arg &optional process-buf command-buf default-dir section) (unless (integerp arg) @@ -840,11 +852,13 @@ as argument." "Git failed"))) (if magit-process-raise-error (signal 'magit-git-error msg) + (--when-let (magit-mode-get-buffer 'magit-status-mode) + (setq magit-this-error msg)) (message "%s ... [%s buffer %s for details]" msg (-if-let (key (and (buffer-live-p command-buf) (with-current-buffer command-buf (car (where-is-internal - 'magit-process-display-buffer))))) + 'magit-process-buffer))))) (format "Hit %s to see" (key-description key)) "See") (buffer-name process-buf))))) diff --git a/elpa/magit-20151223.1425/magit-remote.el b/elpa/magit-20151223.1425/magit-remote.el new file mode 100644 index 00000000..cbca5b52 --- /dev/null +++ b/elpa/magit-20151223.1425/magit-remote.el @@ -0,0 +1,668 @@ +;;; magit-remote.el --- transfer Git commits -*- lexical-binding: t -*- + +;; Copyright (C) 2008-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. + +;;; Commentary: + +;; This library implements support for interacting with remote +;; repositories. Commands for cloning, fetching, pulling, and +;; pushing are defined here. + +;;; Code: + +(require 'magit) + +;;; Clone + +(defcustom magit-clone-set-branch.pushDefault 'ask + "Whether to set the value of `branch.pushDefault' after cloning. + +If t, then set without asking. If nil, then don't set. If +`ask', then ask." + :package-version '(magit . "2.4.0") + :group 'magit-commands + :type '(choice (const "set" t) + (const "ask" ask) + (const "don't set" nil))) + +;;;###autoload +(defun magit-clone (repository directory) + "Clone the REPOSITORY to DIRECTORY. +Then show the status buffer for the new repository." + (interactive + (let ((url (magit-read-string-ns "Clone repository"))) + (list url (read-directory-name + "Clone to: " nil nil nil + (and (string-match "\\([^./]+\\)\\(\\.git\\)?$" url) + (match-string 1 url)))))) + (setq directory (file-name-as-directory (expand-file-name directory))) + (message "Cloning %s..." repository) + (when (= (magit-call-git "clone" repository + ;; Stop cygwin git making a "c:" directory. + (magit-convert-git-filename directory)) + 0) + (when (or (eq magit-clone-set-branch.pushDefault t) + (and magit-clone-set-branch.pushDefault + (y-or-n-p "Set `branch.pushDefault' to \"origin\"? "))) + (magit-call-git "config" "branch.pushDefault" "origin")) + (message "Cloning %s...done" repository) + (magit-status-internal directory))) + +;;; Setup + +(defcustom magit-remote-add-set-branch.pushDefault 'ask-if-unset + "Whether to set the value of `branch.pushDefault' after adding a remote. + +If `ask', then always ask. If `ask-if-unset', then ask, but only +if the variable isn't set already. If nil, then don't ever set. +If the value is a string, then set without asking, provided the +name of the name of the added remote is equal to that string and +the variable isn't already set." + :package-version '(magit . "2.4.0") + :group 'magit-commands + :type '(choice (const "ask if unset" ask-if-unset) + (const "always ask" ask) + (string "set if named") + (const "don't set"))) + +;;;###autoload (autoload 'magit-remote-popup "magit-remote" nil t) +(magit-define-popup magit-remote-popup + "Popup console for remote commands." + 'magit-commands nil nil + :man-page "git-remote" + :actions '((?a "Add" magit-remote-add) + (?r "Rename" magit-remote-rename) + (?k "Remove" magit-remote-remove) + (?u "Set url" magit-remote-set-url))) + +(defun magit-read-url (prompt &optional initial-input) + (let ((url (magit-read-string-ns prompt initial-input))) + (if (string-prefix-p "~" url) + (expand-file-name url) + url))) + +;;;###autoload +(defun magit-remote-add (remote url) + "Add a remote named REMOTE and fetch it." + (interactive (list (magit-read-string-ns "Remote name") + (magit-read-url "Remote url"))) + (if (pcase (list magit-remote-add-set-branch.pushDefault + (magit-get "branch.defaultPush")) + (`(,(pred stringp) ,_) t) + ((or `(ask ,_) `(ask-if-unset nil)) + (y-or-n-p (format "Set `branch.pushDefault' to \"%s\"? " remote)))) + (progn (magit-call-git "remote" "add" "-f" remote url) + (magit-call-git "config" "branch.pushDefault" remote) + (magit-refresh)) + (magit-run-git-async "remote" "add" "-f" remote url))) + +;;;###autoload +(defun magit-remote-rename (old new) + "Rename the remote named OLD to NEW." + (interactive + (let ((remote (magit-read-remote "Rename remote"))) + (list remote (magit-read-string-ns (format "Rename %s to" remote))))) + (unless (string= old new) + (magit-run-git "remote" "rename" old new))) + +;;;###autoload +(defun magit-remote-set-url (remote url) + "Change the url of the remote named REMOTE to URL." + (interactive + (let ((remote (magit-read-remote "Set url of remote"))) + (list remote (magit-read-url + "Url" (magit-get "remote" remote "url"))))) + (magit-run-git "remote" "set-url" remote url)) + +;;;###autoload +(defun magit-remote-remove (remote) + "Delete the remote named REMOTE." + (interactive (list (magit-read-remote "Delete remote"))) + (magit-run-git "remote" "rm" remote)) + +;;; Fetch + +;;;###autoload (autoload 'magit-fetch-popup "magit-remote" nil t) +(magit-define-popup magit-fetch-popup + "Popup console for fetch commands." + 'magit-commands + :man-page "git-fetch" + :switches '((?p "Prune deleted branches" "--prune")) + :actions '("Fetch from" + (?p magit-get-push-remote magit-fetch-from-pushremote) + (?u magit-get-remote magit-fetch-from-upstream) + (?e "elsewhere" magit-fetch) + (?a "all remotes" magit-fetch-all) + "Fetch" + (?m "submodules" magit-submodule-fetch)) + :default-action 'magit-fetch + :max-action-columns 1) + +(defun magit-git-fetch (remote args) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "fetch" remote args)) + +;;;###autoload +(defun magit-fetch-from-pushremote (args) + "Fetch from the push-remote of the current branch." + (interactive (list (magit-fetch-arguments))) + (--if-let (magit-get-push-remote) + (magit-git-fetch it args) + (--if-let (magit-get-current-branch) + (user-error "No push-remote is configured for %s" it) + (user-error "No branch is checked out")))) + +;;;###autoload +(defun magit-fetch-from-upstream (args) + "Fetch from the upstream repository of the current branch." + (interactive (list (magit-fetch-arguments))) + (--if-let (magit-get-remote) + (magit-git-fetch it args) + (--if-let (magit-get-current-branch) + (user-error "No upstream is configured for %s" it) + (user-error "No branch is checked out")))) + +;;;###autoload +(defun magit-fetch (remote args) + "Fetch from another repository." + (interactive (list (magit-read-remote "Fetch remote") + (magit-fetch-arguments))) + (magit-git-fetch remote args)) + +;;;###autoload +(defun magit-fetch-all (args) + "Fetch from all remotes." + (interactive (list (magit-fetch-arguments))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "remote" "update" args)) + +;;;###autoload +(defun magit-fetch-all-prune () + "Fetch from all remotes, and prune. +Prune remote tracking branches for branches that have been +removed on the respective remote." + (interactive) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "remote" "update" "--prune")) + +;;;###autoload +(defun magit-fetch-all-no-prune () + "Fetch from all remotes." + (interactive) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "remote" "update")) + +;;; Pull + +;;;###autoload (autoload 'magit-pull-popup "magit-remote" nil t) +(magit-define-popup magit-pull-popup + "Popup console for pull commands." + 'magit-commands + :man-page "git-pull" + :variables '("Variables" + (?r "branch.%s.rebase" + magit-cycle-branch*rebase + magit-pull-format-branch*rebase)) + :actions '((lambda () + (--if-let (magit-get-current-branch) + (concat + (propertize "Pull into " 'face 'magit-popup-heading) + (propertize it 'face 'magit-branch-local) + (propertize " from" 'face 'magit-popup-heading)) + (propertize "Pull from" 'face 'magit-popup-heading))) + (?p magit-get-push-branch magit-pull-from-pushremote) + (?u magit-get-upstream-branch magit-pull-from-upstream) + (?e "elsewhere" magit-pull)) + :default-action 'magit-pull + :max-action-columns 1) + +;;;###autoload (autoload 'magit-pull-and-fetch-popup "magit-remote" nil t) +(magit-define-popup magit-pull-and-fetch-popup + "Popup console for pull and fetch commands. + +This popup is intended as a replacement for the separate popups +`magit-pull-popup' and `magit-fetch-popup'. To use it, add this +to your init file: + + (with-eval-after-load \\='magit-remote + (define-key magit-mode-map \"f\" \\='magit-pull-and-fetch-popup) + (define-key magit-mode-map \"F\" nil)) + +The combined popup does not offer all commands and arguments +available from the individual popups. Instead of the argument +`--prune' and the command `magit-fetch-all' it uses two commands +`magit-fetch-prune' and `magit-fetch-no-prune'. And the commands +`magit-fetch-from-pushremote' and `magit-fetch-from-upstream' are +missing. To add them use something like: + + (with-eval-after-load \\='magit-remote + (magit-define-popup-action \\='magit-pull-and-fetch-popup ?U + \\='magit-get-upstream-branch + \\='magit-fetch-from-upstream-remote ?F) + (magit-define-popup-action \\='magit-pull-and-fetch-popup ?P + \\='magit-get-push-branch + \\='magit-fetch-from-push-remote ?F))" + 'magit-commands + :man-page "git-pull" + :variables '("Pull variables" + (?r "branch.%s.rebase" + magit-cycle-branch*rebase + magit-pull-format-branch*rebase)) + :actions '((lambda () + (--if-let (magit-get-current-branch) + (concat + (propertize "Pull into " 'face 'magit-popup-heading) + (propertize it 'face 'magit-branch-local) + (propertize " from" 'face 'magit-popup-heading)) + (propertize "Pull from" 'face 'magit-popup-heading))) + (?p magit-get-push-branch magit-pull-from-pushremote) + (?u magit-get-upstream-branch magit-pull-from-upstream) + (?e "elsewhere" magit-pull) + "Fetch from" + (?f "remotes" magit-fetch-all-no-prune) + (?F "remotes and prune" magit-fetch-all-prune) + "Fetch" + (?m "submodules" magit-submodule-fetch)) + :default-action 'magit-fetch + :max-action-columns 1) + +(defun magit-pull-format-branch*rebase () + (magit-popup-format-variable (format "branch.%s.rebase" + (or (magit-get-current-branch) "")) + '("true" "false") + "false" "pull.rebase")) + +(defun magit-git-pull (source args) + (run-hooks 'magit-credential-hook) + (-let [(remote . branch) + (magit-split-branch-name source)] + (magit-run-git-with-editor "pull" args remote branch))) + +;;;###autoload +(defun magit-pull-from-pushremote (args) + "Pull from the push-remote of the current branch." + (interactive (list (magit-pull-arguments))) + (--if-let (magit-get-push-branch) + (magit-git-pull it args) + (--if-let (magit-get-current-branch) + (user-error "No push-remote is configured for %s" it) + (user-error "No branch is checked out")))) + +;;;###autoload +(defun magit-pull-from-upstream (args) + "Pull from the upstream of the current branch." + (interactive (list (magit-pull-arguments))) + (--if-let (magit-get-upstream-branch) + (magit-git-pull it args) + (--if-let (magit-get-current-branch) + (user-error "No upstream is configured for %s" it) + (user-error "No branch is checked out")))) + +;;;###autoload +(defun magit-pull (source args) + "Pull from a branch read in the minibuffer." + (interactive (list (magit-read-remote-branch "Pull" nil nil nil t) + (magit-pull-arguments))) + (magit-git-pull source args)) + +;;; Push + +(defcustom magit-push-current-set-remote-if-missing t + "Whether to configure missing remotes before pushing. + +When nil, then the command `magit-push-current-to-pushremote' and +`magit-push-current-to-upstream' do not appear in the push popup +if the push-remote resp. upstream is not configured. If the user +invokes one of these commands anyway, then it raises an error. + +When non-nil, then these commands always appear in the push +popup. But if the required configuration is missing, then they +do appear in a way that indicates that this is the case. If the +user invokes one of them, then it asks for the necessary +configuration, stores the configuration, and then uses it to push +a first time. + +This option also affects whether the argument `--set-upstream' is +available in the popup. If the value is t, then that argument is +redundant. But note that changing the value of this option does +not take affect immediately, the argument will only be added or +removed after restarting Emacs." + :package-version '(magit . "2.4.0") + :group 'magit-commands + :type 'boolean) + +;;;###autoload (autoload 'magit-push-popup "magit-remote" nil t) +(magit-define-popup magit-push-popup + "Popup console for push commands." + 'magit-commands + :man-page "git-push" + :switches `((?f "Force" "--force-with-lease") + (?h "Disable hooks" "--no-verify") + (?d "Dry run" "--dry-run") + ,@(and (not magit-push-current-set-remote-if-missing) + '((?u "Set upstream" "--set-upstream")))) + :actions '((lambda () + (--when-let (magit-get-current-branch) + (concat (propertize "Push " 'face 'magit-popup-heading) + (propertize it 'face 'magit-branch-local) + (propertize " to" 'face 'magit-popup-heading)))) + (?p magit--push-current-to-pushremote-desc + magit-push-current-to-pushremote) + (?u magit--push-current-to-upstream-desc + magit-push-current-to-upstream) + (?e "elsewhere\n" magit-push-current) + "Push" + (?o "another branch" magit-push) + (?T "a tag" magit-push-tag) + (?m "matching branches" magit-push-matching) + (?t "all tags" magit-push-tags)) + :max-action-columns 2) + +(defun magit-git-push (branch target args) + (run-hooks 'magit-credential-hook) + (-let [(remote . target) + (magit-split-branch-name target)] + (magit-run-git-async-no-revert "push" "-v" args remote + (format "%s:refs/heads/%s" + branch target)))) + +;;;###autoload +(defun magit-push-current-to-pushremote (args &optional push-remote) + "Push the current branch to `branch..pushRemote'. +If that variable is unset, then push to `remote.pushDefault'. + +When `magit-push-current-set-remote-if-missing' is non-nil and +the push-remote is not configured, then read the push-remote from +the user, set it, and then push to it. With a prefix argument +the push-remote can be changed before pushed to it." + (interactive + (list (magit-push-arguments) + (and (magit--push-current-set-pushremote-p current-prefix-arg) + (magit-read-remote (format "Set push-remote of %s and push there" + (magit-get-current-branch)))))) + (--if-let (magit-get-current-branch) + (progn (when push-remote + (magit-call-git "config" + (format "branch.%s.pushRemote" + (magit-get-current-branch)) + push-remote)) + (-if-let (remote (magit-get-push-remote it)) + (if (member remote (magit-list-remotes)) + (magit-git-push it (concat remote "/" it) args) + (user-error "Remote `%s' doesn't exist" remote)) + (user-error "No push-remote is configured for %s" it))) + (user-error "No branch is checked out"))) + +(defun magit--push-current-set-pushremote-p (&optional change) + (and (or change + (and magit-push-current-set-remote-if-missing + (not (magit-get-push-remote)))) + (magit-get-current-branch))) + +(defun magit--push-current-to-pushremote-desc () + (--if-let (magit-get-push-branch) + (concat (magit-branch-set-face it) "\n") + (and (magit--push-current-set-pushremote-p) + (concat (propertize "pushRemote" 'face 'bold) + ", after setting that\n")))) + +;;;###autoload +(defun magit-push-current-to-upstream (args &optional upstream) + "Push the current branch to its upstream branch. + +When `magit-push-current-set-remote-if-missing' is non-nil and +the upstream is not configured, then read the upstream from the +user, set it, and then push to it. With a prefix argument the +upstream can be changed before pushed to it." + (interactive + (list (magit-push-arguments) + (and (magit--push-current-set-upstream-p current-prefix-arg) + (magit-read-remote-branch + (format "Set upstream of %s and push there" + (magit-get-current-branch)))))) + (--if-let (magit-get-current-branch) + (progn + (when upstream + (-let (((remote . merge) (magit-split-branch-name upstream)) + (branch (magit-get-current-branch))) + (magit-call-git "config" (format "branch.%s.remote" branch) remote) + (magit-call-git "config" (format "branch.%s.merge" branch) + (concat "refs/heads/" merge)))) + (-if-let (target (magit-get-upstream-branch it)) + (magit-git-push it target args) + (user-error "No upstream is configured for %s" it))) + (user-error "No branch is checked out"))) + +(defun magit--push-current-set-upstream-p (&optional change) + (and (or change + (and magit-push-current-set-remote-if-missing + (not (magit-get-upstream-branch)))) + (magit-get-current-branch))) + +(defun magit--push-current-to-upstream-desc () + (--if-let (magit-get-upstream-branch) + (concat (magit-branch-set-face it) "\n") + (and (magit--push-current-set-upstream-p) + (concat (propertize "@{upstream}" 'face 'bold) + ", after setting that\n")))) + +;;;###autoload +(defun magit-push-current (target args) + "Push the current branch to a branch read in the minibuffer." + (interactive + (--if-let (magit-get-current-branch) + (list (magit-read-remote-branch (format "Push %s to" it) + nil nil it 'confirm) + (magit-push-arguments)) + (user-error "No branch is checked out"))) + (magit-git-push (magit-get-current-branch) target args)) + +;;;###autoload +(defun magit-push (source target args) + "Push an arbitrary branch or commit somewhere. +Both the source and the target are read in the minibuffer." + (interactive + (let ((source (magit-read-local-branch-or-commit "Push"))) + (list source + (magit-read-remote-branch (format "Push %s to" source) nil + (magit-get-upstream-branch source) + source 'confirm) + (magit-push-arguments)))) + (magit-git-push source target args)) + +;;;###autoload +(defun magit-push-matching (remote &optional args) + "Push all matching branches to another repository. +If multiple remotes exist, then read one from the user. +If just one exists, use that without requiring confirmation." + (interactive (list (magit-read-remote "Push matching branches to" nil t) + (magit-push-arguments))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "push" "-v" args remote ":")) + +;;;###autoload +(defun magit-push-tags (remote &optional args) + "Push all tags to another repository. +If only one remote exists, then push to that. Otherwise prompt +for a remote, offering the remote configured for the current +branch as default." + (interactive (list (magit-read-remote "Push tags to remote" nil t) + (magit-push-arguments))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "push" remote "--tags" args)) + +;;;###autoload +(defun magit-push-tag (tag remote &optional args) + "Push a tag to another repository." + (interactive + (let ((tag (magit-read-tag "Push tag"))) + (list tag (magit-read-remote (format "Push %s to remote" tag) nil t) + (magit-push-arguments)))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "push" remote tag args)) + +;;;###autoload +(defun magit-push-implicitly (args) + "Push somewhere without using an explicit refspec. + +This command simply runs \"git push -v [ARGS]\". ARGS are the +arguments specified in the popup buffer. No explicit refspec +arguments are used. Instead the behavior depends on at least +these Git variables: `push.default', `branch.pushDefault', +`branch..pushRemote', `branch..remote', +`branch..merge', and `remote..push'. + +To add this command to the push popup add this to your init file: + + (with-eval-after-load \\='magit-remote + (magit-define-popup-action \\='magit-push-popup ?P + 'magit-push-implicitly--desc + 'magit-push-implicitly ?p t)) + +The function `magit-push-implicitly--desc' attempts to predict +what this command will do, the value it returns is displayed in +the popup buffer." + (interactive (list (magit-push-arguments))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "push" "-v" args)) + +(defun magit-push-implicitly--desc () + (let ((default (magit-get "push.default"))) + (unless (equal default "nothing") + (or (-when-let* ((remote (or (magit-get-remote) + (magit-remote-p "origin"))) + (refspec (magit-get "remote" remote "push"))) + (format "%s using %s" + (propertize remote 'face 'magit-branch-remote) + (propertize refspec 'face 'bold))) + (--when-let (and (not (magit-get-push-branch)) + (magit-get-upstream-branch)) + (format "%s aka %s\n" + (magit-branch-set-face it) + (propertize "@{upstream}" 'face 'bold))) + (--when-let (magit-get-push-branch) + (format "%s aka %s\n" + (magit-branch-set-face it) + (propertize "pushRemote" 'face 'bold))) + (--when-let (magit-get-@{push}-branch) + (format "%s aka %s\n" + (magit-branch-set-face it) + (propertize "@{push}" 'face 'bold))) + (format "using %s (%s is %s)\n" + (propertize "git push" 'face 'bold) + (propertize "push.default" 'face 'bold) + (propertize default 'face 'bold)))))) + +;;;###autoload +(defun magit-push-to-remote (remote args) + "Push to REMOTE without using an explicit refspec. +The REMOTE is read in the minibuffer. + +This command simply runs \"git push -v [ARGS] REMOTE\". ARGS +are the arguments specified in the popup buffer. No refspec +arguments are used. Instead the behavior depends on at least +these Git variables: `push.default', `branch.pushDefault', +`branch..pushRemote', `branch..remote', +`branch..merge', and `remote..push'. + +To add this command to the push popup add this to your init file: + + (with-eval-after-load \\='magit-remote + (magit-define-popup-action \\='magit-push-popup ?r + 'magit-push-to-remote--desc + 'magit-push-to-remote ?p t))" + (interactive (list (magit-read-remote "Push to remote") + (magit-push-arguments))) + (run-hooks 'magit-credential-hook) + (magit-run-git-async-no-revert "push" "-v" args remote)) + +(defun magit-push-to-remote--desc () + (format "using %s\n" (propertize "git push " 'face 'bold))) + +;;; Email + +;;;###autoload (autoload 'magit-patch-popup "magit-remote" nil t) +(magit-define-popup magit-patch-popup + "Popup console for patch commands." + 'magit-commands + :man-page "git-format-patch" + :options '("Options for formatting patches" + (?f "From" "--from=") + (?t "To" "--to=") + (?c "CC" "--cc=") + (?r "In reply to" "--in-reply-to=") + (?v "Reroll count" "--reroll-count=") + (?s "Thread style" "--thread=") + (?U "Context lines" "-U") + (?M "Detect renames" "-M") + (?C "Detect copies" "-C") + (?A "Diff algorithm" "--diff-algorithm=" + magit-diff-select-algorithm) + (?o "Output directory" "--output-directory=")) + :actions '((?p "Format patches" magit-format-patch) + (?r "Request pull" magit-request-pull)) + :default-action 'magit-format-patch) + +;;;###autoload +(defun magit-format-patch (range args) + "Create patches for the commits in RANGE. +When a single commit is given for RANGE, create a patch for the +changes introduced by that commit (unlike 'git format-patch' +which creates patches for all commits that are reachable from +HEAD but not from the specified commit)." + (interactive + (list (-if-let (revs (magit-region-values 'commit)) + (concat (car (last revs)) "^.." (car revs)) + (let ((range (magit-read-range-or-commit "Format range or commit"))) + (if (string-match-p "\\.\\." range) + range + (format "%s~..%s" range range)))) + (magit-patch-arguments))) + (magit-run-git-no-revert "format-patch" range args)) + +;;;###autoload +(defun magit-request-pull (url start end) + "Request upstream to pull from you public repository. + +URL is the url of your publically accessible repository. +START is a commit that already is in the upstream repository. +END is the last commit, usually a branch name, which upstream +is asked to pull. START has to be reachable from that commit." + (interactive + (list (magit-get "remote" (magit-read-remote "Remote") "url") + (magit-read-branch-or-commit "Start" (magit-get-upstream-branch)) + (magit-read-branch-or-commit "End"))) + (let ((dir default-directory)) + ;; mu4e changes default-directory + (compose-mail) + (setq default-directory dir)) + (message-goto-body) + (let ((inhibit-magit-revert t)) + (magit-git-insert "request-pull" start url end)) + (set-buffer-modified-p nil)) + +;;; magit-remote.el ends soon +(provide 'magit-remote) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: +;;; magit-remote.el ends here diff --git a/elpa/magit-20151119.202/magit-section.el b/elpa/magit-20151223.1425/magit-section.el similarity index 93% rename from elpa/magit-20151119.202/magit-section.el rename to elpa/magit-20151223.1425/magit-section.el index 5c7a33b5..bb894f99 100644 --- a/elpa/magit-20151119.202/magit-section.el +++ b/elpa/magit-20151223.1425/magit-section.el @@ -1,4 +1,4 @@ -;;; magit-section.el --- section functionality +;;; magit-section.el --- section functionality -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -43,7 +43,7 @@ :group 'magit) (defcustom magit-section-show-child-count t - "Whether to append the number of childen to section headings." + "Whether to append the number of children to section headings." :package-version '(magit . "2.1.0") :group 'magit-section :type 'boolean) @@ -83,7 +83,7 @@ until one of them returns non-nil." "Functions used to unhighlight the previously current section. Each function is run with the current section as only argument until one of them returns non-nil. Most sections are properly -unhighlighted without requiring a specialized unhighligher, +unhighlighted without requiring a specialized unhighlighter, diff-related sections being the only exception." :package-version '(magit . "2.1.0") :group 'magit-section @@ -91,16 +91,18 @@ diff-related sections being the only exception." :options '(magit-diff-unhighlight)) (defcustom magit-section-set-visibility-hook - '(magit-diff-expansion-threshold magit-revision-set-visibility) + '(magit-diff-expansion-threshold + magit-section-set-visibility-from-cache) "Hook used to set the initial visibility of a section. Stop at the first function that returns non-nil. The value should be `show' or `hide'. If no function returns non-nil determine the visibility as usual, i.e. use the hardcoded section specific default (see `magit-insert-section')." - :package-version '(magit . "2.1.0") + :package-version '(magit . "2.4.0") :group 'magit-section :type 'hook - :options '(magit-diff-expansion-threshold magit-revision-set-visibility)) + :options '(magit-diff-expansion-threshold + magit-section-set-visibility-from-cache)) (defface magit-section-highlight '((((class color) (background light)) :background "grey95") @@ -164,6 +166,10 @@ IDENT has to be a list as returned by `magit-section-ident'." (pop ident)) section))) +(defvar magit-insert-section--current nil "For internal use only.") +(defvar magit-insert-section--parent nil "For internal use only.") +(defvar magit-insert-section--oldroot nil "For internal use only.") + ;;; Commands ;;;; Movement @@ -268,23 +274,23 @@ It the SECTION has a different type, then do nothing." (when (eq (magit-section-type section) 'hunk) (magit-section-set-window-start section))) -(defmacro magit-define-section-jumper (sym title &optional value) - "Define an interactive function to go to section SYM. -TITLE is the displayed title of the section." - (let ((fun (intern (format "magit-jump-to-%s" sym)))) - `(progn - (defun ,fun (&optional expand) ,(format "\ -Jump to section '%s'. -With a prefix argument also expand it." title) - (interactive "P") - (--if-let (magit-get-section - (cons '(,sym . ,value) (magit-section-ident magit-root-section))) - (progn (goto-char (magit-section-start it)) - (when expand - (with-local-quit (magit-section-show it)) - (recenter 0))) - (message ,(format "Section '%s' wasn't found" title)))) - (put ',fun 'definition-name ',sym)))) +(defmacro magit-define-section-jumper (name heading type &optional value) + "Define an interactive function to go some section. +Together TYPE and VALUE identify the section. +HEADING is the displayed heading of the section." + (declare (indent defun)) + `(defun ,name (&optional expand) ,(format "\ +Jump to the section \"%s\". +With a prefix argument also expand it." heading) + (interactive "P") + (--if-let (magit-get-section + (cons (cons ',type ,value) + (magit-section-ident magit-root-section))) + (progn (goto-char (magit-section-start it)) + (when expand + (with-local-quit (magit-section-show it)) + (recenter 0))) + (message ,(format "Section \"%s\" wasn't found" heading))))) ;;;; Visibility @@ -307,6 +313,7 @@ With a prefix argument also expand it." title) (magit-section-update-highlight)) (-when-let (beg (magit-section-content section)) (remove-overlays beg (magit-section-end section) 'invisible t)) + (magit-section-update-visibility-cache section) (dolist (child (magit-section-children section)) (if (magit-section-hidden child) (magit-section-hide child) @@ -590,7 +597,7 @@ section at point. If no clause succeeds or if there is no section at point return nil. See `magit-section-match' for the forms CONDITION can take. -Additionall a CONDITION of t is allowed in the final clause, and +Additionally a CONDITION of t is allowed in the final clause, and matches if no other CONDITION match, even if there is no section at point." (declare (indent 0) @@ -606,10 +613,6 @@ at point." clauses))))) ;;; Create -(defvar magit-insert-section--current nil "For internal use only.") -(defvar magit-insert-section--parent nil "For internal use only.") -(defvar magit-insert-section--oldroot nil "For internal use only.") - (defvar magit-insert-section-hook nil "Hook run after `magit-insert-section's BODY. Avoid using this hook and only ever do so if you know @@ -733,7 +736,7 @@ inside any of these strings, then insert all of them unchanged. Otherwise use the `magit-section-heading' face for all inserted text. -The `content' property of the secton struct is the end of the +The `content' property of the section struct is the end of the heading (which lasts from `start' to `content') and the beginning of the the body (which lasts from `content' to `end'). If the value of `content' is nil, then the section has no heading and @@ -932,6 +935,44 @@ invisible." (or (magit-get-section (magit-section-ident it)) (magit-section-goto-successor-1 it))))) +;;; Visibility + +(defvar-local magit-section-visibility-cache nil) +(put 'magit-section-visibility-cache 'permanent-local t) + +(defun magit-section-set-visibility-from-cache (section) + (and (member (magit-section-visibility-ident section) + magit-section-visibility-cache) + 'hide)) + +(cl-defun magit-section-cache-visibility + (&optional (section magit-insert-section--current)) + (let ((ident (magit-section-visibility-ident section))) + (if (magit-section-hidden section) + (cl-pushnew ident magit-section-visibility-cache :test #'equal) + (setq magit-section-visibility-cache + (delete ident magit-section-visibility-cache))))) + +(defun magit-section-update-visibility-cache (section) + (setq magit-section-visibility-cache + (delete (magit-section-visibility-ident section) + magit-section-visibility-cache))) + +(defun magit-section-visibility-ident (section) + (let ((type (magit-section-type section)) + (value (magit-section-value section))) + (cons type + (cond ((not (memq type '(unpulled unpushed))) value) + ((string-match-p "@{upstream}" value) value) + ;; Unfortunately Git chokes on "@{push}" when the + ;; value of `push.default' does not allow a 1:1 + ;; mapping. But collapsed logs of unpushed and + ;; unpulled commits in the status buffer should + ;; remain invisible after changing branches. + ;; So we have to pretend the value is constant. + ((string-match-p "\\`\\.\\." value) "..@{push}") + (t "@{push}.."))))) + ;;; Utilities (cl-defun magit-section-selected-p (section &optional (selection nil sselection)) diff --git a/elpa/magit-20151119.202/magit-sequence.el b/elpa/magit-20151223.1425/magit-sequence.el similarity index 87% rename from elpa/magit-20151119.202/magit-sequence.el rename to elpa/magit-20151223.1425/magit-sequence.el index 47446c13..14e56893 100644 --- a/elpa/magit-20151119.202/magit-sequence.el +++ b/elpa/magit-20151223.1425/magit-sequence.el @@ -1,4 +1,4 @@ -;;; magit-sequence.el --- history manipulation in Magit +;;; magit-sequence.el --- history manipulation in Magit -*- lexical-binding: t -*- ;; Copyright (C) 2011-2015 The Magit Project Contributors ;; @@ -121,7 +121,7 @@ This discards all changes made since the sequence started." (?x "Reference cherry in commit message" "-x") (?F "Attempt fast-forward" "--ff") (?m "Reply merge relative to parent" "--mainline=")) - :options '((?s "Strategy" "--strategy=" read-from-minibuffer)) + :options '((?s "Strategy" "--strategy=")) :actions '((?A "Cherry Pick" magit-cherry-pick) (?a "Cherry Apply" magit-cherry-apply)) :sequence-actions '((?A "Continue" magit-sequencer-continue) @@ -171,7 +171,7 @@ without prompting." 'magit-commands :man-page "git-revert" :switches '((?s "Add Signed-off-by lines" "--signoff")) - :options '((?s "Strategy" "--strategy=" read-from-minibuffer)) + :options '((?s "Strategy" "--strategy=")) :actions '((?V "Revert commit(s)" magit-revert) (?v "Revert changes" magit-revert-no-commit)) :sequence-actions '((?V "Continue" magit-sequencer-continue) @@ -291,20 +291,30 @@ This discards all changes made since the sequence started." "Key menu for rebasing." 'magit-commands :man-page "git-rebase" - :switches '((?k "Keep empty commits" "--keep-empty") - (?p "Preserve merges" "--preserve-merges") + :switches '((?k "Keep empty commits" "--keep-empty") + (?p "Preserve merges" "--preserve-merges") (?c "Lie about author date" "--committer-date-is-author-date") - (?a "Autosquash" "--autosquash") - (?A "Autostash" "--autostash") - (?i "Interactive" "--interactive")) - :actions '((?r "Rebase" magit-rebase) - (?f "Autosquash" magit-rebase-autosquash) - (?o "Rebase subset" magit-rebase-subset) - nil - (?i "Rebase interactive" magit-rebase-interactive) - (?e "Edit commit" magit-rebase-edit-commit) - (?l "Rebase unpushed" magit-rebase-unpushed) - (?w "Reword commit" magit-rebase-reword-commit)) + (?a "Autosquash" "--autosquash") + (?A "Autostash" "--autostash") + (?i "Interactive" "--interactive")) + :actions '((lambda () + (concat (propertize "Rebase " 'face 'magit-popup-heading) + (propertize (or (magit-get-current-branch) "HEAD") + 'face 'magit-branch-local) + (propertize " onto" 'face 'magit-popup-heading))) + (?p (lambda () + (--when-let (magit-get-push-branch) (concat it "\n"))) + magit-rebase-onto-pushremote) + (?u (lambda () + (--when-let (magit-get-upstream-branch) (concat it "\n"))) + magit-rebase-onto-upstream) + (?e "elsewhere" magit-rebase) + "Rebase" + (?i "interactively" magit-rebase-interactive) + (?m "to edit a commit" magit-rebase-edit-commit) + (?s "subset" magit-rebase-subset) + (?w "to reword a commit" magit-rebase-reword-commit) nil + (?f "to autosquash" magit-rebase-autosquash)) :sequence-actions '((?r "Continue" magit-rebase-continue) (?s "Skip" magit-rebase-skip) (?e "Edit" magit-rebase-edit) @@ -312,28 +322,51 @@ This discards all changes made since the sequence started." :sequence-predicate 'magit-rebase-in-progress-p :max-action-columns 2) +(defun magit-git-rebase (target args) + (magit-run-git-sequencer "rebase" target args)) + ;;;###autoload -(defun magit-rebase (upstream &optional args) - "Start a non-interactive rebase sequence. -All commits not in UPSTREAM are rebased." - (interactive (list (magit-read-other-branch-or-commit - "Rebase onto" - (magit-get-current-branch) - (magit-get-tracked-branch)) +(defun magit-rebase-onto-pushremote (args) + "Rebase the current branch onto `branch..pushRemote'. +If that variable is unset, then rebase onto `remote.pushDefault'." + (interactive (list (magit-rebase-arguments))) + (--if-let (magit-get-current-branch) + (-if-let (remote (magit-get-push-remote it)) + (if (member remote (magit-list-remotes)) + (magit-git-rebase (concat remote "/" it) args) + (user-error "Remote `%s' doesn't exist" remote)) + (user-error "No push-remote is configured for %s" it)) + (user-error "No branch is checked out"))) + +;;;###autoload +(defun magit-rebase-onto-upstream (args) + "Rebase the current branch onto its upstream branch." + (interactive (list (magit-rebase-arguments))) + (--if-let (magit-get-current-branch) + (-if-let (target (magit-get-upstream-branch it)) + (magit-git-rebase target args) + (user-error "No upstream is configured for %s" it)) + (user-error "No branch is checked out"))) + +;;;###autoload +(defun magit-rebase (target args) + "Rebase the current branch onto a branch read in the minibuffer. +All commits that are reachable from head but not from the +selected branch TARGET are being rebased." + (interactive (list (magit-read-other-branch-or-commit "Rebase onto") (magit-rebase-arguments))) (message "Rebasing...") - (magit-run-git-sequencer "rebase" upstream args) + (magit-git-rebase target args) (message "Rebasing...done")) ;;;###autoload -(defun magit-rebase-subset (newbase start &optional args) - "Start a non-interactive rebase sequence. +(defun magit-rebase-subset (newbase start args) + "Rebase a subset of the current branches history onto a new base. Rebase commits from START to `HEAD' onto NEWBASE. START has to be selected from a list of recent commits." (interactive (list (magit-read-other-branch-or-commit - "Rebase subset onto" - (magit-get-current-branch) - (magit-get-tracked-branch)) + "Rebase subset onto" nil + (magit-get-upstream-branch)) nil (magit-rebase-arguments))) (if start @@ -350,7 +383,7 @@ START has to be selected from a list of recent commits." (declare (indent 2)) (when commit (if (eq commit :merge-base) - (setq commit (--if-let (magit-get-tracked-branch) + (setq commit (--if-let (magit-get-upstream-branch) (magit-git-string "merge-base" it "HEAD") nil)) (when (magit-git-failure "merge-base" "--is-ancestor" commit "HEAD") @@ -376,7 +409,7 @@ START has to be selected from a list of recent commits." message))) ;;;###autoload -(defun magit-rebase-interactive (commit &optional args) +(defun magit-rebase-interactive (commit args) "Start an interactive rebase sequence." (interactive (list (magit-commit-at-point) (magit-rebase-arguments))) @@ -384,22 +417,15 @@ START has to be selected from a list of recent commits." "Type %p on a commit to rebase it and all commits above it,")) ;;;###autoload -(defun magit-rebase-unpushed (&optional args) - "Start an interactive rebase sequence of all unpushed commits." - (interactive (list (magit-rebase-arguments))) - (magit-rebase-interactive-1 :merge-base args - "Type %p on a commit to rebase it and all commits above it,")) - -;;;###autoload -(defun magit-rebase-autosquash (&optional args) +(defun magit-rebase-autosquash (args) "Combine squash and fixup commits with their intended targets." (interactive (list (magit-rebase-arguments))) (magit-rebase-interactive-1 :merge-base (cons "--autosquash" args) - "Type %p on a commit to squash into it and the commits above it," + "Type %p on a commit to squash into it and then rebase as necessary," "true")) ;;;###autoload -(defun magit-rebase-edit-commit (commit &optional args) +(defun magit-rebase-edit-commit (commit args) "Edit a single older commit using rebase." (interactive (list (magit-commit-at-point) (magit-rebase-arguments))) @@ -408,7 +434,7 @@ START has to be selected from a list of recent commits." "perl -i -p -e '++$x if not $x and s/^pick/edit/'")) ;;;###autoload -(defun magit-rebase-reword-commit (commit &optional args) +(defun magit-rebase-reword-commit (commit args) "Reword a single older commit using rebase." (interactive (list (magit-commit-at-point) (magit-rebase-arguments))) diff --git a/elpa/magit-20151119.202/magit-stash.el b/elpa/magit-20151223.1425/magit-stash.el similarity index 97% rename from elpa/magit-20151119.202/magit-stash.el rename to elpa/magit-20151223.1425/magit-stash.el index 1b639f14..c46679b7 100644 --- a/elpa/magit-20151119.202/magit-stash.el +++ b/elpa/magit-20151223.1425/magit-stash.el @@ -1,4 +1,4 @@ -;;; magit-stash.el --- stash support for Magit +;;; magit-stash.el --- stash support for Magit -*- lexical-binding: t -*- ;; Copyright (C) 2008-2015 The Magit Project Contributors ;; @@ -292,7 +292,8 @@ When the region is active offer to drop all contained stashes." map) "Keymap for `stash' sections.") -(magit-define-section-jumper stashes "Stashes" "refs/stash") +(magit-define-section-jumper magit-jump-to-stashes + "Stashes" stashes "refs/stash") (cl-defun magit-insert-stashes (&optional (ref "refs/stash") (heading "Stashes:")) @@ -353,7 +354,7 @@ instead of \"Stashes:\"." :group 'magit-diff (hack-dir-local-variables-non-file-buffer)) -(defun magit-stash-refresh-buffer (stash _const args files) +(defun magit-stash-refresh-buffer (stash _const _args _files) (setq header-line-format (concat "\s" (propertize (capitalize stash) 'face 'magit-section-heading) @@ -365,7 +366,9 @@ instead of \"Stashes:\"." (magit-insert-section (commit commit) (magit-insert-heading message) (magit-git-wash #'magit-diff-wash-diffs - "diff" (cdr magit-refresh-args) "--no-prefix" "-u" range "--" files))) + "diff" range "-p" "--no-prefix" + (nth 2 magit-refresh-args) + "--" (or files (nth 3 magit-refresh-args))))) (defun magit-insert-stash-index () "Insert section showing the index commit of the stash." diff --git a/elpa/magit-20151119.202/magit-utils.el b/elpa/magit-20151223.1425/magit-utils.el similarity index 98% rename from elpa/magit-20151119.202/magit-utils.el rename to elpa/magit-20151223.1425/magit-utils.el index aed42851..8b2b535e 100644 --- a/elpa/magit-20151119.202/magit-utils.el +++ b/elpa/magit-20151223.1425/magit-utils.el @@ -1,4 +1,4 @@ -;;; magit-utils.el --- various utilities +;;; magit-utils.el --- various utilities -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; @@ -158,7 +158,7 @@ Global settings: (const safe-with-wip)))) (defcustom magit-ellipsis ?… - "Character used to abreviate text." + "Character used to abbreviate text." :package-version '(magit . "2.1.0") :group 'magit-modes :type 'character) @@ -360,7 +360,7 @@ This is similar to `read-string', but ;;; Text Utilities (defmacro magit-bind-match-strings (varlist string &rest body) - "Bind varibles to submatches accoring to VARLIST then evaluate BODY. + "Bind variables to submatches according to VARLIST then evaluate BODY. Bind the symbols in VARLIST to submatches of the current match data, starting with 1 and incrementing by 1 for each symbol. If the last match was against a string then that has to be provided diff --git a/elpa/magit-20151119.202/magit-wip.el b/elpa/magit-20151223.1425/magit-wip.el similarity index 99% rename from elpa/magit-20151119.202/magit-wip.el rename to elpa/magit-20151223.1425/magit-wip.el index 26caa3c9..9255dce2 100644 --- a/elpa/magit-20151119.202/magit-wip.el +++ b/elpa/magit-20151223.1425/magit-wip.el @@ -1,4 +1,4 @@ -;;; magit-wip.el --- commit snapshots to work-in-progress refs +;;; magit-wip.el --- commit snapshots to work-in-progress refs -*- lexical-binding: t -*- ;; Copyright (C) 2010-2015 The Magit Project Contributors ;; diff --git a/elpa/magit-20151119.202/magit.el b/elpa/magit-20151223.1425/magit.el similarity index 84% rename from elpa/magit-20151119.202/magit.el rename to elpa/magit-20151223.1425/magit.el index 48ac5d8b..da157fe8 100644 --- a/elpa/magit-20151119.202/magit.el +++ b/elpa/magit-20151223.1425/magit.el @@ -1,4 +1,4 @@ -;;; magit.el --- A Git porcelain inside Emacs +;;; magit.el --- A Git porcelain inside Emacs -*- lexical-binding: t -*- ;; Copyright (C) 2008-2015 The Magit Project Contributors ;; @@ -16,7 +16,7 @@ ;; Rémi Vanicat ;; Yann Hodique -;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113") (with-editor "20151111") (git-commit "20151111") (magit-popup "20151111")) +;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113") (with-editor "20151111") (git-commit "20151111") (magit-popup "20151221")) ;; Keywords: git tools vc ;; Homepage: https://github.com/magit/magit @@ -84,9 +84,10 @@ :type 'hook) (defcustom magit-status-headers-hook - '(magit-insert-diff-filter-header + '(magit-insert-error-header + magit-insert-diff-filter-header magit-insert-head-branch-header - magit-insert-pull-branch-header + magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header) "Hook run to insert headers into the status buffer. @@ -97,11 +98,12 @@ at all." :package-version '(magit . "2.1.0") :group 'magit-status :type 'hook - :options '(magit-insert-diff-filter-header + :options '(magit-insert-error-header + magit-insert-diff-filter-header magit-insert-repo-header magit-insert-remote-header magit-insert-head-branch-header - magit-insert-pull-branch-header + magit-insert-upstream-branch-header magit-insert-push-branch-header magit-insert-tags-header)) @@ -118,10 +120,12 @@ at all." magit-insert-unstaged-changes magit-insert-staged-changes magit-insert-stashes - magit-insert-unpulled-commits - magit-insert-unpushed-commits) + magit-insert-unpulled-from-upstream + magit-insert-unpulled-from-pushremote + magit-insert-unpushed-to-upstream + magit-insert-unpushed-to-pushremote) "Hook run to insert sections into a status buffer." - :package-version '(magit . "2.1.0") + :package-version '(magit . "2.4.0") :group 'magit-status :type 'hook) @@ -150,7 +154,8 @@ at all." :type 'hook) (defcustom magit-refs-sections-hook - '(magit-insert-branch-description + '(magit-insert-error-header + magit-insert-branch-description magit-insert-local-branches magit-insert-remote-branches magit-insert-tags) @@ -206,6 +211,44 @@ the remote branch and then checking out the new local branch." :group 'magit-commands :type 'boolean) +(defcustom magit-branch-prefer-remote-upstream nil + "Whether to favor remote upstreams when creating new branches. + +When a new branch is created, Magit offers the branch, commit, or +stash as the default starting point of the new branch. If there +is no such thing at point, then it falls back to offer the +current branch as starting-point. The user may then accept that +default or pick something else. + +If the chosen starting-point is a branch, then it may also be set +as the upstream of the new branch, depending on the value of the +Git variable `branch.autoSetupMerge'. By default this is done +for remote branches, but not for local branches. + +You might prefer to always use some remote branch as upstream. +If the chosen starting-point is (1) a local branch, (2) whose +name is a member of the value of this option, (3) the upstream of +that local branch is a remote branch with the same name, and (4) +that remote branch can be fast-forwarded to the local branch, +then the chosen branch is used as starting-point, but its own +upstream is used as the upstream of the new branch. + +Assuming the chosen branch matches these conditions you would end +up with with e.g.: + + feature --upstream--> origin/master + +instead of + + feature --upstream--> master --upstream--> origin/master + +Which you prefer is a matter of personal preference. If you do +prefer the former, then you should add branches such as \"master\", +\"next\", and \"maint\" to the value of this options." + :package-version '(magit . "2.4.0") + :group 'magit-commands + :type '(repeat string)) + (defcustom magit-repository-directories nil "Directories containing Git repositories. Magit checks these directories for Git repositories and offers @@ -329,8 +372,10 @@ deep." (define-key map "jn" 'magit-jump-to-untracked) (define-key map "ju" 'magit-jump-to-unstaged) (define-key map "js" 'magit-jump-to-staged) - (define-key map "jf" 'magit-jump-to-unpulled) - (define-key map "jp" 'magit-jump-to-unpushed) + (define-key map "jfu" 'magit-jump-to-unpulled-from-upstream) + (define-key map "jfp" 'magit-jump-to-unpulled-from-pushremote) + (define-key map "jpu" 'magit-jump-to-unpushed-to-upstream) + (define-key map "jpp" 'magit-jump-to-unpushed-to-pushremote) map) "Keymap for `magit-status-mode'.") @@ -400,10 +445,19 @@ then offer to initialize it as a new repository." ;;;;; Standard Status Sections +(defvar magit-status-sections-hook-1 nil) + (defun magit-status-refresh-buffer () (magit-git-exit-code "update-index" "--refresh") (magit-insert-section (status) - (run-hooks 'magit-status-sections-hook)) + (if (-all-p #'functionp magit-status-sections-hook) + (run-hooks 'magit-status-sections-hook) + (message "`magit-status-sections-hook' contains entries that are \ +no longer valid.\nUsing standard value instead. Please re-configure") + (sit-for 5) + (let ((magit-status-sections-hook-1 + (eval (car (get 'magit-status-sections-hook 'standard-value))))) + (run-hooks 'magit-status-sections-hook-1)))) (run-hooks 'magit-status-refresh-hook)) (defun magit-insert-status-headers () @@ -414,10 +468,29 @@ The sections are inserted by running the functions on the hook (magit-insert-headers magit-status-headers-hook) (insert "In the beginning there was darkness\n\n"))) +(defun magit-insert-error-header () + "Insert the message about the Git error that just occured. + +This function is only aware of the last error that occur when Git +was run for side-effects. If, for example, an error occurs while +generating a diff, then that error won't be inserted. Refreshing +the status buffer causes this section to disappear again." + (when magit-this-error + (magit-insert-section (error 'git) + (insert (propertize (format "%-10s" "GitError! ") + 'face 'magit-section-heading)) + (insert (propertize magit-this-error 'face 'font-lock-warning-face)) + (-when-let (key (car (where-is-internal 'magit-process-buffer))) + (insert (format " [Type `%s' for details]" (key-description key)))) + (insert ?\n)) + (setq magit-this-error nil))) + (cl-defun magit-insert-head-branch-header (&optional (branch (magit-get-current-branch))) - "Insert a header line about the current branch or detached `HEAD'." - (let ((output (magit-rev-format "%h %s" "HEAD"))) + "Insert a header line about BRANCH. +When BRANCH is nil, use the current branch or, if none, the +detached `HEAD'." + (let ((output (magit-rev-format "%h %s" (or branch "HEAD")))) (string-match "^\\([^ ]+\\) \\(.*\\)" output) (magit-bind-match-strings (commit summary) output (if branch @@ -430,11 +503,11 @@ The sections are inserted by running the functions on the hook (insert (propertize commit 'face 'magit-hash)) (insert ?\s summary ?\n)))))) -(cl-defun magit-insert-pull-branch-header +(cl-defun magit-insert-upstream-branch-header (&optional (branch (magit-get-current-branch)) - (pull (magit-get-tracked-branch branch)) + (pull (magit-get-upstream-branch branch)) keyword) - "Insert a header line about branch normally pulled into the current branch." + "Insert a header line about branch usually pulled into current branch." (when pull (magit-insert-section (branch pull) (insert (format "%-10s" @@ -455,7 +528,7 @@ The sections are inserted by running the functions on the hook (cl-defun magit-insert-push-branch-header (&optional (branch (magit-get-current-branch)) (push (magit-get-push-branch branch))) - "Insert a header line about the branch the current branch is pushed to" + "Insert a header line about the branch the current branch is pushed to." (when push (magit-insert-section (branch push) (insert (format "%-10s" "Push: ")) @@ -501,7 +574,7 @@ The sections are inserted by running the functions on the hook (insert (mapconcat #'identity magit-diff-section-file-args " ")) (insert ?\n)))) -(magit-define-section-jumper untracked "Untracked files") +(magit-define-section-jumper magit-jump-to-untracked "Untracked files" untracked) (defvar magit-untracked-section-map (let ((map (make-sparse-keymap))) @@ -547,7 +620,7 @@ Do so depending on the value of `status.showUntrackedFiles'." ;;;;; Auxiliary Status Sections -(magit-define-section-jumper tracked "Tracked files") +(magit-define-section-jumper magit-jump-to-tracked "Tracked files" tracked) (defun magit-insert-tracked-files () "Insert a tree of tracked files." @@ -595,10 +668,10 @@ remote in alphabetic order." To make this command available use something like: - (add-hook 'ido-setup-hook + (add-hook \\='ido-setup-hook (lambda () (define-key ido-completion-map - (kbd \"C-x g\") 'ido-enter-magit-status))) + (kbd \"C-x g\") \\='ido-enter-magit-status))) Starting with Emacs 25.1 the Ido keymaps are defined just once instead of every time Ido is invoked, so now you can modify it @@ -696,24 +769,27 @@ Refs are compared with a branch read form the user." (magit-show-refs-arguments))) (magit-mode-setup #'magit-refs-mode ref args)) -(defun magit-branch-manager () - "The Branch Manager is dead, long live the Branch Manager. - -\\\ -Please use the new top-level binding `\\[magit-show-refs-popup]'. -The old binding `b v' will be removed soon." - (interactive) - (magit-show-refs-head) - (message (documentation 'magit-branch-manager)) - (sit-for 3)) - -(defun magit-refs-refresh-buffer (&rest ignore) +(defun magit-refs-refresh-buffer (&rest _ignore) (setq magit-set-buffer-margin-refresh (not magit-show-margin)) (unless (magit-rev-verify (or (car magit-refresh-args) "HEAD")) (setq magit-refs-show-commit-count nil)) (magit-insert-section (branchbuf) (run-hooks 'magit-refs-sections-hook))) +(defun magit-insert-branch-description () + "Insert header containing the description of the current branch. +Insert a header line with the name and description of the +current branch. The description is taken from the Git variable +`branch..description'; if that is undefined then no header +line is inserted at all." + (let ((branch (magit-get-current-branch))) + (--when-let (magit-git-lines + "config" (format "branch.%s.description" branch)) + (magit-insert-section (branchdesc branch t) + (magit-insert-heading branch ": " (car it)) + (insert (mapconcat 'identity (cdr it) "\n")) + (insert "\n\n"))))) + (defconst magit-refs-branch-line-re (concat "^" "\\(?:[ \\*]\\) " @@ -816,7 +892,7 @@ reference, but it is not checked out." (string-match magit-refs-branch-line-re line) (magit-bind-match-strings (branch hash message upstream ahead behind gone) line - (when (string-match-p "(" branch) + (when (string-match-p "(HEAD detached" branch) (setq branch nil)) (magit-insert-branch branch magit-refs-local-branch-format current branches @@ -1149,27 +1225,59 @@ Non-interactively DIRECTORY is (re-)initialized unconditionally." (magit-status-internal directory)) ;;;; Branch +;;;;; Branch Popup ;;;###autoload (autoload 'magit-branch-popup "magit" nil t) (magit-define-popup magit-branch-popup "Popup console for branch commands." 'magit-commands :man-page "git-branch" - :switches '((?t "Set upstream configuration" "--track")) - :actions '((?c "Create" magit-branch) - (?u "Set upstream" magit-branch-set-upstream) - (?k "Delete" magit-branch-delete) - (?b "Checkout" magit-checkout) - (?U "Unset upstream" magit-branch-unset-upstream) - (?r "Rename" magit-branch-rename) - (?B "Create & checkout" magit-branch-and-checkout) - (?e "Set description" magit-branch-edit-description) - (?v "(Branch Manager)" magit-branch-manager) - (?s "Spin off" magit-branch-spinoff) nil nil - (?x "Reset" magit-branch-reset)) - :default-arguments '("--track") + :variables '("Configure existing branches" + (?d "branch.%s.description" + magit-edit-branch*description + magit-format-branch*description) + (?u "branch.%s.merge" + magit-set-branch*merge/remote + magit-format-branch*merge/remote) + (?r "branch.%s.rebase" + magit-cycle-branch*rebase + magit-format-branch*rebase) + (?p "branch.%s.pushRemote" + magit-cycle-branch*pushRemote + magit-format-branch*pushRemote) + "Configure repository defaults" + (?\M-r "pull.rebase" + magit-cycle-pull.rebase + magit-format-pull.rebase) + (?\M-p "remote.pushDefault" + magit-cycle-remote.pushDefault + magit-format-remote.pushDefault) + "Configure branch creation" + (?U "branch.autoSetupMerge" + magit-cycle-branch*autoSetupMerge + magit-format-branch*autoSetupMerge) + (?R "branch.autoSetupRebase" + magit-cycle-branch*autoSetupRebase + magit-format-branch*autoSetupRebase)) + :actions '((?c "Create and checkout" magit-branch-and-checkout) + (?b "Checkout" magit-checkout) + (?n "Create" magit-branch) + (?m "Rename" magit-branch-rename) + (?s "Create spin-off" magit-branch-spinoff) + (?x "Reset" magit-branch-reset) nil + (?k "Delete" magit-branch-delete)) :default-action 'magit-checkout - :max-action-columns 3) + :max-action-columns 2 + :setup-function 'magit-branch-popup-setup) + +(defun magit-branch-popup-setup (val def) + (magit-popup-default-setup val def) + (use-local-map (copy-keymap magit-popup-mode-map)) + (dolist (ev (-filter #'magit-popup-event-p (magit-popup-get :variables))) + (local-set-key (vector (magit-popup-event-key ev)) + 'magit-invoke-popup-action))) + +;;;;; Branch Actions ;;;###autoload (defun magit-checkout (revision) @@ -1187,35 +1295,49 @@ changes. "Create BRANCH at branch or revision START-POINT. \n(git branch [ARGS] BRANCH START-POINT)." (interactive (magit-branch-read-args "Create branch")) - (magit-run-git-no-revert "branch" args branch start-point)) + (magit-call-git "branch" args branch start-point) + (--when-let (and (magit-get-upstream-branch branch) + (magit-get-indirect-upstream-branch start-point)) + (magit-call-git "branch" (concat "--set-upstream-to=" it) branch)) + (magit-refresh)) ;;;###autoload (defun magit-branch-and-checkout (branch start-point &optional args) "Create and checkout BRANCH at branch or revision START-POINT. \n(git checkout [ARGS] -b BRANCH START-POINT)." - (interactive (magit-branch-read-args "Create and checkout branch" - (magit-stash-at-point))) + (interactive (magit-branch-read-args "Create and checkout branch")) (if (string-match-p "^stash@{[0-9]+}$" start-point) (magit-run-git "stash" "branch" branch start-point) - (magit-run-git "checkout" args "-b" branch start-point))) + (magit-call-git "checkout" args "-b" branch start-point) + (--when-let (and (magit-get-upstream-branch branch) + (magit-get-indirect-upstream-branch start-point)) + (magit-call-git "branch" (concat "--set-upstream-to=" it) branch)) + (magit-refresh))) -(defun magit-branch-read-args (prompt &optional secondary-default) +(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-read-branch-or-commit (concat prompt " starting at") - secondary-default)) - (setq branch (magit-read-string-ns - "Branch name" - (and (member start (magit-list-remote-branch-names)) - (mapconcat #'identity - (cdr (split-string start "/")) "/"))))) - (t - (setq branch (magit-read-string-ns "Branch name")) - (setq start (magit-read-branch-or-commit (concat prompt " starting at") - secondary-default)))) - (unless (magit-branch-p start) - (setq args (delete "--track" args))) + (cond (magit-branch-read-upstream-first + (setq start (magit-branch-read-starting-point prompt)) + (setq branch (magit-read-string-ns + "Branch name" + (and (member start (magit-list-remote-branch-names)) + (mapconcat #'identity + (cdr (split-string start "/")) + "/"))))) + (t + (setq branch (magit-read-string-ns "Branch name")) + (setq start (magit-branch-read-starting-point prompt)))) (list branch start args))) ;;;###autoload @@ -1229,7 +1351,13 @@ upstream or no unpushed commits, then the new branch is created anyway and the previously current branch is not touched. This is useful to create a feature branch after work has already -began on the old branch (likely but not necessarily \"master\")." +began on the old branch (likely but not necessarily \"master\"). + +If the current branch is a member of the value of option +`magit-branch-prefer-remote-upstream' (which see), then the +current branch will be used as the starting point as usual, but +the upstream of the starting-point may be used as the upstream +of the new branch, instead of the starting-point itself." (interactive (list (magit-read-string "Spin off branch") (magit-branch-arguments))) (when (magit-branch-p branch) @@ -1237,13 +1365,15 @@ began on the old branch (likely but not necessarily \"master\")." (-if-let (current (magit-get-current-branch)) (let (tracked base) (magit-call-git "checkout" args "-b" branch current) - (if (and (setq tracked (magit-get-tracked-branch current)) - (setq base (magit-git-string "merge-base" current tracked)) - (not (magit-rev-equal base current))) - (magit-run-git "update-ref" "-m" - (format "reset: moving to %s" base) - (concat "refs/heads/" current) base) - (magit-refresh))) + (--when-let (magit-get-indirect-upstream-branch current) + (magit-call-git "branch" "--set-upstream-to" it branch)) + (when (and (setq tracked (magit-get-upstream-branch current)) + (setq base (magit-git-string "merge-base" current tracked)) + (not (magit-rev-equal base current))) + (magit-call-git "update-ref" "-m" + (format "reset: moving to %s" base) + (concat "refs/heads/" current) base)) + (magit-refresh)) (magit-run-git "checkout" "-b" branch))) ;;;###autoload @@ -1267,7 +1397,7 @@ realize it's all crap and want to start over." (delete branch (magit-list-branch-names)) nil nil nil 'magit-revision-history (or (and (not (equal branch atpoint)) atpoint) - (magit-get-tracked-branch branch))) + (magit-get-upstream-branch branch))) (magit-branch-arguments)))) (unless (member "--force" args) (setq args (cons "--force" args))) @@ -1280,7 +1410,7 @@ realize it's all crap and want to start over." (not (yes-or-no-p "Uncommitted changes will be lost. Proceed?"))) (user-error "Abort") (magit-reset-hard to) - (magit-branch-set-upstream branch to)) + (magit-set-branch*merge/remote branch to)) (magit-branch branch to args))) ;;;###autoload @@ -1355,24 +1485,6 @@ defaulting to the branch at point." (put 'magit-branch-delete 'interactive-only t) -;;;###autoload -(defun magit-branch-set-upstream (branch upstream) - "Change the UPSTREAM branch of BRANCH." - (interactive - (let ((branch (magit-read-local-branch "Change upstream of branch"))) - (list branch (magit-completing-read - "Change upstream to branch" - (delete branch (magit-list-branch-names)) - nil nil nil 'magit-revision-history)))) - (magit-run-git-no-revert "branch" (concat "--set-upstream-to=" upstream) - branch)) - -;;;###autoload -(defun magit-branch-unset-upstream (branch) - "Unset the upstream branch of BRANCH." - (interactive (list (magit-read-local-branch "Unset upstream of branch"))) - (magit-run-git-no-revert "branch" "--unset-upstream" branch)) - ;;;###autoload (defun magit-branch-rename (old new &optional force) "Rename branch OLD to NEW. @@ -1386,25 +1498,224 @@ With prefix, forces the rename even if NEW already exists. (unless (string= old new) (magit-run-git-no-revert "branch" (if force "-M" "-m") old new))) +;;;;; Branch Variables + ;;;###autoload -(defun magit-branch-edit-description (branch) - "Edit the description of BRANCH." - (interactive (list (magit-read-local-branch "Edit branch description"))) - (magit-run-git-with-editor "branch" "--edit-description")) +(defun magit-edit-branch*description (branch) + "Edit the description of the current branch. +With a prefix argument edit the description of another branch. -(defun magit-insert-branch-description () - "Insert header containing the description of the current branch. -Insert a header line with the name and description of the -current branch. The description is taken from the Git variable -`branch..description'; if that is undefined then no header -line is inserted at all." - (let ((branch (magit-get-current-branch))) - (--when-let (magit-git-lines - "config" (format "branch.%s.description" branch)) - (magit-insert-section (branchdesc branch t) - (magit-insert-heading branch ": " (car it)) - (insert (mapconcat 'identity (cdr it) "\n")) - (insert "\n\n"))))) +The description for the branch named NAME is stored in the Git +variable `branch..description'." + (interactive + (list (or (and (not current-prefix-arg) + (magit-get-current-branch)) + (magit-read-local-branch "Edit branch description")))) + (magit-run-git-with-editor "branch" "--edit-description" branch)) + +(defun magit-edit-branch*description-check-buffers () + (and buffer-file-name + (string-match-p "/BRANCH_DESCRIPTION\\'" buffer-file-name) + (add-hook 'with-editor-post-finish-hook + (lambda () + (when (derived-mode-p 'magit-popup-mode) + (magit-refresh-popup-buffer))) + nil t))) + +(add-hook 'find-file-hook 'magit-edit-branch*description-check-buffers) + +(defun magit-format-branch*description () + (let* ((branch (or (magit-get-current-branch) "")) + (width (+ (length branch) 19)) + (var (format "branch.%s.description" branch))) + (concat var " " (make-string (- width (length var)) ?\s) + (-if-let (value (magit-get var)) + (propertize value 'face 'magit-popup-option-value) + (propertize "unset" 'face 'magit-popup-disabled-argument))))) + +;;;###autoload +(defun magit-set-branch*merge/remote (branch upstream) + "Set or unset the upstream of the current branch. +With a prefix argument do so for another branch. + +When the branch in question already has an upstream then simply +unsets it. Invoke this command again to set another upstream. + +Together the Git variables `branch..remote' and +`branch..merge' define the upstream branch of the local +branch named NAME. The value of `branch..remote' is the +name of the upstream remote. The value of `branch..merge' +is the full reference of the upstream branch, on the remote." + (interactive + (let ((branch (or (and (not current-prefix-arg) + (magit-get-current-branch)) + (magit-read-local-branch "Change upstream of branch")))) + (list branch (and (not (magit-get-upstream-branch branch)) + (magit-completing-read + (format "Change upstream of %s to" branch) + (delete branch (magit-list-branch-names)) + nil nil nil 'magit-revision-history))))) + (if upstream + (magit-run-git-no-revert + "branch" (concat "--set-upstream-to=" upstream) branch) + (magit-run-git-no-revert "branch" "--unset-upstream" branch))) + +(defun magit-format-branch*merge/remote () + (let* ((branch (or (magit-get-current-branch) "")) + (width (+ (length branch) 20)) + (varM (format "branch.%s.merge" branch)) + (varR (format "branch.%s.remote" branch)) + (face (if (equal (magit-get varR) ".") + 'magit-branch-local + 'magit-branch-remote))) + (concat varM (make-string (- width (length varM)) ?\s) + (-if-let (value (magit-get varM)) + (propertize value 'face face) + (propertize "unset" 'face 'magit-popup-disabled-argument)) + "\n " varR (make-string (- width (length varR)) ?\s) + (-if-let (value (magit-get varR)) + (propertize value 'face face) + (propertize "unset" 'face 'magit-popup-disabled-argument))))) + +;;;###autoload +(defun magit-cycle-branch*rebase (branch) + "Cycle the value of `branch..rebase' for the current branch. +With a prefix argument cycle the value for another branch. + +The Git variables `branch..rebase' controls whether pulling +into the branch named NAME is done by rebasing that branch onto +the fetched branch or by merging that branch. + +When `true' then pulling is done by rebasing. +When `false' then pulling is done by merging. + +When that variable is undefined then the value of `pull.rebase' +is used instead. It defaults to `false'." + (interactive + (list (or (and (not current-prefix-arg) + (magit-get-current-branch)) + (magit-read-local-branch "Cycle branch..rebase for")))) + (magit-popup-set-variable (format "branch.%s.rebase" branch) + '("true" "false") + "false" "pull.rebase")) + +(defun magit-format-branch*rebase () + (let ((branch (or (magit-get-current-branch) ""))) + (magit-popup-format-variable (format "branch.%s.rebase" branch) + '("true" "false") + "false" "pull.rebase" + (+ (length branch) 20)))) + +;;;###autoload +(defun magit-cycle-branch*pushRemote (branch) + "Cycle the value of `branch..pushRemote' for the current branch. +With a prefix argument cycle the value for another branch. + +The Git variable `branch..pushRemote' specifies the remote +that the branch named NAME is usually pushed to. The value has +to be the name of an existing remote. + +If that variable is undefined, then the value of the Git variable +`remote.pushDefault' is used instead, provided that it is defined, +which by default it is not." + (interactive + (list (or (and (not current-prefix-arg) + (magit-get-current-branch)) + (magit-read-local-branch "Cycle branch..pushRemote for")))) + (magit-popup-set-variable (format "branch.%s.pushRemote" branch) + (magit-list-remotes) + "remote.pushDefault")) + +(defun magit-format-branch*pushRemote () + (let ((branch (or (magit-get-current-branch) ""))) + (magit-popup-format-variable (format "branch.%s.pushRemote" branch) + (magit-list-remotes) + nil "remote.pushDefault" + (+ (length branch) 20)))) + +;;;###autoload +(defun magit-cycle-pull.rebase () + "Cycle the repository-local value of `pull.rebase'. + +The Git variable `pull.rebase' specifies whether pulling is done +by rebasing or by merging. It can be overwritten using the Git +variable `branch..rebase'. + +When `true' then pulling is done by rebasing. +When `false' (the default) then pulling is done by merging." + (interactive) + (magit-popup-set-variable "pull.rebase" '("true" "false") "false")) + +(defun magit-format-pull.rebase () + (magit-popup-format-variable "pull.rebase" '("true" "false") "false" nil 19)) + +;;;###autoload +(defun magit-cycle-remote.pushDefault () + "Cycle the repository-local value of `remote.pushDefault'. + +The Git variable `remote.pushDefault' specifies the remote that +local branches are usually pushed to. It can be overwritten +using the Git variable `branch..pushRemote'." + (interactive) + (magit-popup-set-variable "remote.pushDefault" (magit-list-remotes))) + +(defun magit-format-remote.pushDefault () + (magit-popup-format-variable "remote.pushDefault" + (magit-list-remotes) nil nil 19)) + +;;;###autoload +(defun magit-cycle-branch*autoSetupMerge () + "Cycle the repository-local value of `branch.autoSetupMerge'. + +The Git variable `branch.autoSetupMerge' under what circumstances +creating a branch (named NAME) should result in the variables +`branch..merge' and `branch..remote' being set +according to the starting point used to create the branch. If +the starting point isn't a branch, then these variables are never +set. + +When `always' then the variables are set regardless of whether +the starting point is a local or a remote branch. + +When `true' (the default) then the variable are set when the +starting point is a remote branch, but not when it is a local +branch. + +When `false' then the variables are never set." + (interactive) + (magit-popup-set-variable "branch.autoSetupMerge" + '("always" "true" "false") "true")) + +(defun magit-format-branch*autoSetupMerge () + (magit-popup-format-variable "branch.autoSetupMerge" + '("always" "true" "false") "true" nil 23)) + +;;;###autoload +(defun magit-cycle-branch*autoSetupRebase () + "Cycle the repository-local value of `branch.autoSetupRebase'. + +The Git variable `branch.autoSetupRebase' specifies whether +creating a branch (named NAME) should result in the variable +`branch..rebase' being set to `true'. + +When `always' then the variable is set regardless of whether the +starting point is a local or a remote branch. + +When `local' then the variable are set when the starting point +is a local branch, but not when it is a remote branch. + +When `remote' then the variable are set when the starting point +is a remote branch, but not when it is a local branch. + +When `never' (the default) then the variable is never set." + (interactive) + (magit-popup-set-variable "branch.autoSetupRebase" + '("always" "local" "remote" "never") "never")) + +(defun magit-format-branch*autoSetupRebase () + (magit-popup-format-variable "branch.autoSetupRebase" + '("always" "local" "remote" "never") + "never" nil 23)) ;;;; Merge @@ -1416,7 +1727,7 @@ line is inserted at all." :switches '((?f "Fast-forward only" "--ff-only") (?n "No fast-forward" "--no-ff") (?s "Squash" "--squash")) - :options '((?s "Strategy" "--strategy=" read-from-minibuffer)) + :options '((?s "Strategy" "--strategy=")) :actions '((?m "Merge" magit-merge) (?e "Merge and edit message" magit-merge-editmsg) (?p "Preview merge" magit-merge-preview) @@ -1562,7 +1873,7 @@ If no merge is in progress, do nothing." (defun magit-reset-index (commit) "Reset the index to COMMIT. Keep the head and working tree as-is, so if COMMIT refers to the -head this effectivley unstages all changes. +head this effectively unstages all changes. \n(git reset COMMIT)" (interactive (list (magit-read-branch-or-commit "Reset index to"))) (magit-reset-internal nil commit ".")) @@ -1722,7 +2033,7 @@ With a prefix argument annotate the tag. (magit-read-branch-or-commit "Place tag on") (let ((args (magit-tag-arguments))) (when current-prefix-arg - (add-to-list 'args "--annotate")) + (cl-pushnew "--annotate" args)) args))) (magit-run-git-with-editor "tag" args name rev)) @@ -1744,7 +2055,7 @@ defaulting to the tag at point. (let* ((remote (magit-read-remote "Prune tags using remote")) (tags (magit-list-tags)) (rtags (prog2 (message "Determining remote tags...") - (magit-list-remote-tags remote) + (magit-remote-list-tags remote) (message "Determining remote tags...done"))) (ltags (-difference tags rtags)) (rtags (-difference rtags tags))) @@ -1770,9 +2081,12 @@ defaulting to the tag at point. "Popup console for notes commands." 'magit-commands :man-page "git-tag" - :switches '((?n "Dry run" "--dry-run")) - :options '((?r "Manipulate ref" "--ref=" magit-notes-popup-read-ref) - (?s "Merge strategy" "--strategy=" read-from-minibuffer)) + :switches '("Switch for prune" + (?n "Dry run" "--dry-run")) + :options '("Option for edit and remove" + (?r "Manipulate ref" "--ref=" magit-notes-popup-read-ref) + "Option for merge" + (?s "Merge strategy" "--strategy=")) :actions '((?T "Edit" magit-notes-edit) (?r "Remove" magit-notes-remove) (?m "Merge" magit-notes-merge) @@ -1803,7 +2117,8 @@ Interactively or when optional REF is nil use the value of Git variable `core.notesRef' or \"refs/notes/commits\" if that is undefined." (interactive (magit-notes-read-args "Remove notes")) - (magit-run-git-with-editor "notes" "remove" commit)) + (magit-run-git-with-editor "notes" (and ref (concat "--ref=" ref)) + "remove" commit)) (defun magit-notes-merge (ref) "Merge the notes ref REF into the current notes ref. @@ -2002,7 +2317,7 @@ With a prefix argument fetch all remotes." "Keymap for `magit-file-mode'.") (magit-define-popup magit-file-popup - "Popup consule for Magit commands in file-visiting buffers." + "Popup console for Magit commands in file-visiting buffers." :actions '((?s "Stage" magit-stage-file) (?l "Log" magit-log-buffer-file) (?c "Commit" magit-commit-popup) @@ -2033,9 +2348,6 @@ Currently this only adds the following key bindings. :package-version '(magit . "2.2.0") :group 'magit-modes) -(define-obsolete-function-alias 'global-magit-file-buffer-mode - 'global-magit-file-mode "2.3.0") - ;;;; Blob Mode (defvar magit-blob-mode-map @@ -2099,7 +2411,7 @@ Currently this only adds the following key bindings. (defun magit-blob-successor (rev file) (let ((lines (magit-with-toplevel (magit-git-lines "log" "--format=%H" "--name-only" "--follow" - "HEAD" "--" "lisp/magit-blame.el")))) + "HEAD" "--" file)))) (catch 'found (while lines (if (equal (nth 2 lines) rev) @@ -2682,11 +2994,17 @@ If the value already is just \"git\" but TRAMP never-the-less doesn't find the executable, then consult the info node `(tramp)Remote programs'.\n" remote) :error))))) +(define-obsolete-function-alias 'global-magit-file-buffer-mode + 'global-magit-file-mode "Magit 2.3.0") + (define-obsolete-function-alias 'magit-insert-head-header 'magit-insert-head-branch-header "Magit 2.4.0") (define-obsolete-function-alias 'magit-insert-upstream-header - 'magit-insert-pull-branch-header "Magit 2.4.0") + 'magit-insert-upstream-branch-header "Magit 2.4.0") + +(define-obsolete-function-alias 'magit-insert-pull-branch-header + 'magit-insert-upstream-branch-header "Magit 2.4.0") (provide 'magit) diff --git a/elpa/magit-20151223.1425/magit.info b/elpa/magit-20151223.1425/magit.info new file mode 100644 index 00000000..2f6b7f8c --- /dev/null +++ b/elpa/magit-20151223.1425/magit.info @@ -0,0 +1,158 @@ +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 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: 1217 +magit.info-2: 306253 + +Tag Table: +(Indirect) +Node: Top1217 +Node: Introduction5670 +Node: Installation10363 +Node: Updating from an older release10738 +Node: Installing from an Elpa archive12333 +Node: Installing from the Git repository13891 +Node: Post-installation tasks16128 +Node: Getting started17654 +Node: Interface concepts23389 +Node: Modes and Buffers23715 +Node: Switching Buffers25330 +Node: Naming Buffers28394 +Node: Quitting Windows31229 +Node: Automatic save32815 +Node: Automatic refresh and revert33880 +Node: Sections38680 +Node: Section movement39632 +Node: Section visibility43559 +Node: Section hooks47150 +Node: Section types and values49188 +Node: Section options50458 +Node: Popup buffers and prefix commands50930 +Node: Completion and confirmation52244 +Node: Running Git55150 +Node: Viewing Git output55386 +Node: Running Git manually56386 +Node: Git executable58512 +Node: Global Git arguments60519 +Node: Inspecting61326 +Node: Status buffer62453 +Node: Status sections64976 +Node: Status header sections69723 +Node: Status options72282 +Node: Logging73006 +Node: Refreshing logs75373 +Node: Log Buffer76758 +Node: Select from log79847 +Node: Reflog80787 +Node: Diffing81265 +Node: Refreshing diffs84077 +Node: Diff buffer87058 +Node: Diff options88960 +Node: Revision buffer90592 +Node: Ediffing91547 +Node: References buffer94596 +Node: References sections99306 +Node: Bisecting100181 +Node: Visiting blobs101677 +Node: Blaming102186 +Node: Manipulating105506 +Node: Repository setup105798 +Node: Staging and unstaging106838 +Node: Staging from file-visiting buffers109187 +Node: Applying110355 +Node: Committing111998 +Node: Initiating a commit112581 +Node: Editing commit messages115893 +Node: Branching126289 +Node: Merging138576 +Node: Rebasing140660 +Node: Editing rebase sequences143608 +Node: Rebase sequence log146642 +Node: Cherry picking153386 +Node: Reverting154992 +Node: Resetting156355 +Node: Stashing157865 +Node: Transferring161010 +Node: Remotes161248 +Node: Fetching162534 +Node: Pulling163511 +Node: Pushing164237 +Node: Creating and sending patches168566 +Node: Applying patches169261 +Node: Miscellaneous170259 +Node: Tagging170550 +Node: Notes171335 +Node: Submodules173860 +Node: Common commands175180 +Node: Wip modes176928 +Node: Minor mode for buffers visiting files183664 +Node: Minor mode for buffers visiting blobs185807 +Node: Customizing186612 +Node: Per-repository configuration188284 +Node: Essential settings189918 +Node: Safety190242 +Node: Performance193476 +Node: Plumbing200122 +Node: Calling Git200750 +Node: Getting a value from Git202273 +Node: Calling Git for effect205377 +Node: Section plumbing211881 +Node: Creating sections212109 +Node: Section selection215912 +Node: Matching sections217592 +Node: Refreshing buffers222794 +Node: Conventions225929 +Node: Confirmation and completion226106 +Node: Theming Faces227004 +Node: FAQ235155 +Node: Magit is slow236325 +Node: I changed several thousand files at once and now Magit is unusable236526 +Node: I am having problems committing237242 +Node: I don't like how branching and pushing works237695 +Node: I cannot install the pre-requisites for Magit v2238175 +Node: I am using an Emacs release older than v244238649 +Node: I am using a Git release older than v194240262 +Node: I am using MS Windows and cannot push with Magit241249 +Node: How to install the gitman info manual?241828 +Node: How can I show Git's output?244354 +Node: Expanding a file to show the diff causes it to disappear245166 +Node: Point is wrong in the COMMIT_EDITMSG buffer245692 +Node: Can Magit be used as ediff-version-control-package?246710 +Node: How to show diffs for gpg-encrypted files?248734 +Node: Emacs 245 hangs when loading Magit249325 +Node: Keystroke Index249844 +Node: Command Index277035 +Node: Function Index306253 +Node: Variable Index317867 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/elpa/magit-20151119.202/magit.info-1 b/elpa/magit-20151223.1425/magit.info-1 similarity index 93% rename from elpa/magit-20151119.202/magit.info-1 rename to elpa/magit-20151223.1425/magit.info-1 index d24bb1b0..c9e4ab84 100644 --- a/elpa/magit-20151119.202/magit.info-1 +++ b/elpa/magit-20151223.1425/magit.info-1 @@ -232,7 +232,7 @@ FAQ * I changed several thousand files at once and now Magit is unusable:: * I am having problems committing:: * I don't like how branching and pushing works:: -* I cannot install the pre-requisits for Magit v2:: +* I cannot install the pre-requisites for Magit v2:: * I am using an Emacs release older than v24.4: I am using an Emacs release older than v244. * I am using a Git release older than v1.9.4: I am using a Git release older than v194. * I am using MS Windows and cannot push with Magit:: @@ -398,19 +398,19 @@ yourself with it by reading the documentation in the Emacs manual, see (require 'package) (add-to-list 'package-archives - '("melpa" . "http://melpa.org/packages/") t) + '("melpa" . "http://melpa.org/packages/") t) • To use Melpa-Stable: (require 'package) (add-to-list 'package-archives - '("melpa-stable" . "http://stable.melpa.org/packages/") t) + '("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) + '("marmalade" . "http://marmalade-repo.org/packages/") t) Once you have added your preferred archive, you need to update the local package list using: @@ -463,7 +463,7 @@ before running ‘make’: (with-eval-after-load 'info (info-initialize) (add-to-list 'Info-directory-list - "~/.emacs.d/site-lisp/magit/Documentation/")) + "~/.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. @@ -958,16 +958,18 @@ undesirable. Revert the buffers synchronously and be quiet about it. - This is the recommended setting, because for the other values - the revert messages might prevent you from seeing other, more - important, messages in the echo area. + This (or a negative number) is the recommended setting, + because for the other values the revert messages might prevent + you from seeing other, more important, messages in the echo + area. • NUMBER - An integer or float. Revert the buffers asynchronously, - mentioning each one as it is being reverted. If user input - arrives, then stop reverting. After NUMBER seconds resume - reverting. + An integer or float. Revert the buffers asynchronously. If + NUMBER is positive, then mention each buffer as it is being + reverted. If it is negative, then be quiet about it. If user + input arrives, then stop reverting. After (the absolute value + of) NUMBER seconds resume reverting. Buffers can also be refreshed explicitly, which is useful in buffers that weren’t current during the last refresh and after changes were made @@ -1687,9 +1689,9 @@ that it should be bound globally. We recommend using ‘C-x g’: To make this command available, use something like: (add-hook 'ido-setup-hook - (lambda () - (define-key ido-completion-map - (kbd \"C-x g\") 'ido-enter-magit-status))) + (lambda () + (define-key ido-completion-map + (kbd \"C-x g\") 'ido-enter-magit-status))) Starting with Emacs 25.1 the Ido keymaps are defined just once instead of every time Ido is invoked, so now you can modify it like @@ -1774,13 +1776,25 @@ default the following functions are also members of that hook: HEADING is non-nil use that as section heading instead of "Stashes:". - -- Function: magit-insert-unpulled-commits + -- Function: magit-insert-unpulled-from-upstream - Insert section showing unpulled commits. + Insert section showing commits that haven’t been pulled from the + upstream branch yet. - -- Function: magit-insert-unpushed-commits + -- Function: magit-insert-unpulled-from-pushremote - Insert section showing unpushed commits. + Insert section showing commits that haven’t been pulled from the + push-remote branch yet. + + -- Function: magit-insert-unpushed-to-upstream + + Insert section showing commits that haven’t been pushed to the + upstream yet. + + -- Function: magit-insert-unpushed-to-pushremote + + Insert section showing commits that haven’t been pushed to the + push-remote yet. The following functions can also be added to the above hook: @@ -1861,13 +1875,33 @@ variable. By default the following functions are members of the above hook: - -- Function: magit-insert-head-header + -- Function: magit-insert-error-header + + Insert a header line showing the message about the Git error that + just occurred. + + This function is only aware of the last error that occur when Git + was run for side-effects. If, for example, an error occurs while + generating a diff, then that error won’t be inserted. Refreshing + the status buffer causes this section to disappear again. + + -- Function: magit-insert-diff-filter-header + + Insert a header line showing the effective diff filters. + + -- Function: magit-insert-head-branch-header + + Insert a header line about the current branch or detached ‘HEAD’. - Insert a header line about the ‘HEAD’ commit. + -- Function: magit-insert-upstream-branch-header - -- Function: magit-insert-upstream-header + Insert a header line about the branch that is usually pulled into + the current branch. - Insert a header line about the upstream branch and its tip. + -- Function: magit-insert-push-branch-header + + Insert a header line about the branch that the current branch is + usually pushed to. -- Function: magit-insert-tags-header @@ -2225,14 +2259,6 @@ the default value of ‘magit-diff-arguments’ is used instead. Show changes between any two files on disk. -‘M-x magit-diff-unpushed’ (‘magit-diff-unpushed’) - - Show unpushed changes. - -‘M-x magit-diff-unpulled’ (‘magit-diff-unpulled’) - - Show unpulled changes. - All of the above suffix commands update the repository’s diff buffer. The diff popup also features two commands which show differences in another buffer: @@ -2919,6 +2945,13 @@ File: magit.info, Node: Repository setup, Next: Staging and unstaging, Up: Ma The user is queried for a remote url and a local directory. + -- User Option: magit-clone-set-branch.pushDefault + + Whether to set the value of ‘branch.pushDefault’ after cloning. + + If ‘t’, then set without asking. If ‘nil’, then don’t set. If + ‘ask’, then ask the user every time she clones a repository. +  File: magit.info, Node: Staging and unstaging, Next: Applying, Prev: Repository setup, Up: Manipulating @@ -3429,12 +3462,170 @@ File: magit.info, Node: Branching, Next: Merging, Prev: Committing, Up: Mani 6.5 Branching ============= -Also see *note (gitman)git-branch:: and *note (gitman)git-checkout:: . +The upstream branch of some local branch is the branch into which the +commits on that local branch should eventually be merged, usually +something like ‘origin/master’. For the ‘master’ branch itself the +upstream branch and the branch it is being pushed to, are usually the +same remote branch. But for a feature branch the upstream branch and +the branch it is being pushed to should differ. + + Feature branches too should _eventually_ end up in a remote branch +such as ‘origin/master’ or ‘origin/maint’. Such a branch should +therefore be used as the upstream. But feature branches shouldn’t be +pushed directly to such branches. Instead a feature branch ‘my-feature’ +is usually pushed to ‘my-fork/my-feature’ or ‘origin/my-feature’. After +the new feature has been reviewed, the maintainer merges the feature +into ‘master’. And finally ‘master’ (not ‘my-feature’ itself) is pushed +to ‘origin/master’. + + But new features seldom are perfect on the first try, and so feature +branches usually have to be improved and re-pushed many times. Pushing +should therefore be easy to do, and for that reason some users have +concluded that the remote branch to which a feature branch is being +pushed should be set as the upstream. Luckily Git has long ago gained +support for a push-remote which can be configured separately from the +upstream branch, using the variables ‘branch..pushRemote’ and +‘remote.pushDefault’, so we no longer have to choose which of the two +remotes should be used as "the remote". + + Each of the fetching, pulling, and pushing popups features three +commands which act on the current branch and some other branch. Of +these, ‘p’ is bound to a command which acts on the push-remote, ‘u’ is +bound to a command which acts on the upstream, and ‘e’ is bound to a +command which acts on any other branch. The status buffer shows +unpushed and unpulled for both the push-remote and the upstream. + + It’s fairly simple to configure these two remotes. The values of all +the variables that are related to fetching, pulling, and pushing (as +well as some other branch-related variables) can be inspected and +changed in the branching popup. It is also possible to set the +push-remote and/or upstream while pushing (see *note Pushing: Pushing.). ‘b’ (‘magit-branch-popup’) - This prefix command shows the following suffix commands along with - the appropriate infix arguments in a popup buffer. + This prefix command shows the following suffix commands in a popup + buffer. It also displays the values of the following variables and + allows changing their values. + + The following variables are used to configure a specific branch. The +values are being displayed for the current branch (if any). To change +the value for another branch use a prefix argument. + + -- Variable: branch.NAME.merge + + Together with ‘branch.NAME.remote’ this variable defines the + upstream branch of the local branch named NAME. The value of this + variable is the full reference of the upstream _branch_. + + -- Variable: branch.NAME.remote + + Together with ‘branch.NAME.merge’ this variable defines the + upstream branch of the local branch named NAME. The value of this + variable is the name of the upstream _remote_. + + -- Variable: branch.NAME.rebase + + This variable controls whether pulling into the branch named NAME + is done by rebasing or by merging the fetched branch. + + • When ‘true’ then pulling is done by rebasing. + + • When ‘false’ then pulling is done by merging. + + • When undefined then the value of ‘pull.rebase’ is used. The + default of that variable is ‘false’. + + -- Variable: branch.NAME.pushRemote + + This variable specifies the remote that the branch named NAME is + usually pushed to. The value has to be the name of an existing + remote. + + It is not possible to specify the name of _branch_ to push the + local branch to. The name of the remote branch is always the same + as the name of the local branch. + + If this variable is undefined but ‘remote.pushDefault’ is defined, + then the value of the latter is used. By default + ‘remote.pushDefault’ is undefined. + + -- Variable: branch.NAME.description + + This variable can be used to describe the branch named NAME. That + description is used e.g. when turning the branch into a series of + patches. + + The following variables specify defaults which are used if the above +branch-specific variables are not set. + + -- Variable: pull.rebase + + This variable specifies whether pulling is done by rebasing or by + merging. It can be overwritten using ‘branch.NAME.rebase’. + + • When ‘true’ then pulling is done by rebasing. + + • When ‘false’ (the default) then pulling is done by merging. + Since it is never a good idea to merge the upstream branch into a + feature or hotfix branch and most branches are such branches, you + should consider setting this to ‘true’, and ‘branch.master.rebase’ + to ‘false’. + + -- Variable: remote.pushDefault + + This variable specifies what remote the local branches are usually + pushed to. This can be overwritten per branch using + ‘branch.NAME.pushRemote’. + + The following variables are used during the creation of a branch and +control whether the various branch-specific variables are automatically +set at this time. + + -- Variable: branch.autoSetupMerge + + This variable specifies under what circumstances creating a branch + NAME should result in the variables ‘branch.NAME.merge’ and + ‘branch.NAME.remote’ being set according to the starting point used + to create the branch. If the starting point isn’t a branch, then + these variables are never set. + + • When ‘always’ then the variables are set regardless of whether + the starting point is a local or a remote branch. + + • When ‘true’ (the default) then the variable are set when the + staring point is a remote branch, but not when it is a local + branch. + + • When ‘false’ then the variables are never set. + + -- Variable: branch.autoSetupRebase + + This variable specifies whether creating a branch NAME should + result in the variable ‘branch.NAME.rebase’ being set to ‘true’. + + • When ‘always’ then the variable is set regardless of whether + the starting point is a local or a remote branch. + + • When ‘local’ then the variable are set when the starting point + is a local branch, but not when it is a remote branch. + + • When ‘remote’ then the variable are set when the starting + point is a remote branch, but not when it is a local branch. + + • When ‘never’ (the default) then the variable is never set. + + Note that the respective commands always change the repository-local +values. If you want to change the global value, which is used when the +local value is undefined, then you have to do so on the command line, +e.g.: + + git config --global remote.autoSetupMerge always + + For more information about these variables you should also see + + *note (gitman)git-config:: . Also see *note (gitman)git-branch:: , + + *note (gitman)git-checkout:: , and *note Pushing: Pushing. ‘b b’ (‘magit-checkout’) @@ -3444,7 +3635,7 @@ Also see *note (gitman)git-branch:: and *note (gitman)git-checkout:: . else then ‘HEAD’ becomes detached. Checkout fails if the working tree or the staging area contain changes. -‘b c’ (‘magit-branch’) +‘b n’ (‘magit-branch’) Create a new branch. The user is asked for a branch or arbitrary revision to use as the starting point of the new branch. When a @@ -3452,11 +3643,15 @@ Also see *note (gitman)git-branch:: and *note (gitman)git-checkout:: . the new branch. The name of the new branch is also read in the minibuffer. -‘b B’ (‘magit-branch-and-checkout’) + Also see option ‘magit-branch-prefer-remote-upstream’. + +‘b c’ (‘magit-branch-and-checkout’) This command creates a new branch like ‘magit-branch’, but then also checks it out. + Also see option ‘magit-branch-prefer-remote-upstream’. + ‘b s’ (‘magit-branch-spinoff’) This command creates and checks out a new branch starting at and @@ -3468,6 +3663,12 @@ Also see *note (gitman)git-branch:: and *note (gitman)git-checkout:: . This is useful to create a feature branch after work has already began on the old branch (likely but not necessarily "master"). + If the current branch is a member of the value of option + ‘magit-branch-prefer-remote-upstream’ (which see), then the current + branch will be used as the starting point as usual, but the + upstream of the starting-point may be used as the upstream of the + new branch, instead of the starting-point itself. + ‘b x’ (‘magit-branch-reset’) This command resets a branch, defaulting to the branch at point, to @@ -3490,33 +3691,54 @@ Also see *note (gitman)git-branch:: and *note (gitman)git-checkout:: . branches, then offer to delete those. Otherwise, prompt for a single branch to be deleted, defaulting to the branch at point. -‘b u’ (‘magit-branch-set-upstream’) - - Change the upstream branch of a branch. Both branches are read in - the minibuffer, while providing reasonable defaults. - -‘b U’ (‘magit-branch-unset-upstream’) - - Unset the upstream branch of a branch read in the minibuffer and - defaulting to the branch at point or the current branch. - ‘b r’ (‘magit-branch-rename’) Rename a branch. The branch and the new name are read in the minibuffer. With prefix argument the branch is renamed even if that name conflicts with an existing branch. -‘b e’ (‘magit-branch-edit-description’) - - Edit the description of a branch. The branch is read in the - minibuffer defaulting to the branch at point or the current branch. - The description is edited in a regular buffer similar to how commit - messages are edited. - -- User Option: magit-branch-read-upstream-first When creating a branch, whether to read the upstream branch before - the name of the branch that is to be created. + the name of the branch that is to be created. The default is + ‘nil’, and I recommend you leave it at that. + + -- User Option: magit-branch-prefer-remote-upstream + + This option specifies whether remote upstreams are favored over + local upstreams when creating new branches. + + When a new branch is created, Magit offers the branch, commit, or + stash as the default starting point of the new branch. If there is + no such thing at point, then it falls back to offer the current + branch as starting-point. The user may then accept that default or + pick something else. + + If the chosen starting-point is a branch, then it may also be set + as the upstream of the new branch, depending on the value of the + Git variable ‘branch.autoSetupMerge’. By default this is done for + remote branches, but not for local branches. + + You might prefer to always use some remote branch as upstream. If + the chosen starting-point is (1) a local branch, (2) whose name is + a member of the value of this option, (3) the upstream of that + local branch is a remote branch with the same name, and (4) that + remote branch can be fast-forwarded to the local branch, then the + chosen branch is used as starting-point, but its own upstream is + used as the upstream of the new branch. + + Assuming the chosen branch matches these conditions you would end + up with with e.g.: + + feature --upstream--> origin/master + + instead of + + feature --upstream--> master --upstream--> origin/master + + Which you prefer is a matter of personal preference. If you do + prefer the former, then you should add branches such as ‘master’, + ‘next’, and ‘maint’ to the value of this options.  File: magit.info, Node: Merging, Next: Rebasing, Prev: Branching, Up: Manipulating @@ -3594,10 +3816,20 @@ Also see *note (gitman)git-rebase:: . When no rebase is in progress, then the popup buffer features the following commands. -‘r r’ (‘magit-rebase’) +‘r p’ (‘magit-rebase-onto-pushremote’) + + Rebase the current branch onto ‘branch..pushRemote’. If that + variable is unset, then rebase onto ‘remote.pushDefault’. + +‘r u’ (‘magit-rebase-onto-upstream’) - Start a non-interactive rebase sequence. All commits not in - UPSTREAM are rebased. + Rebase the current branch onto its upstream branch. + +‘r e’ (‘magit-rebase’) + + Rebase the current branch onto a branch read in the minibuffer. + All commits that are reachable from head but not from the selected + branch TARGET are being rebased." ‘r o’ (‘magit-rebase-subset’) @@ -3610,9 +3842,9 @@ This can be used to turn one of the above non-interactive rebase variants into an interactive rebase. For example if you want to clean up a feature branch and at the same -time rebase it onto ‘master’, then you could use ‘r-ir’. But we -recommend that you instead do that in two steps. First use ‘rs’ to -cleanup the feature branch, and then in a second step ‘rl’ to rebase it +time rebase it onto ‘master’, then you could use ‘r-iu’. But we +recommend that you instead do that in two steps. First use ‘ri’ to +cleanup the feature branch, and then in a second step ‘ru’ to rebase it onto ‘master’. That way if things turn out to be more complicated than you thought and/or you make a mistake and have to start over, then you only have to redo half the work. @@ -3625,20 +3857,11 @@ is not enabled in the popup. Start an interactive rebase sequence. -‘r l’ (‘magit-rebase-unpushed’) - - Start an interactive rebase sequence of unpushed commits. This is - like ‘magit-rebase-interactive’, but if the upstream of the current - branch is configured, then all commits since the merge-base are - rebased. If there is no upstream or no merge-base, then the user - has to select the first commit to be rebased like for - ‘magit-rebase-interactive’. - ‘r f’ (‘magit-rebase-autosquash’) Combine squash and fixup commits with their intended targets. -‘r e’ (‘magit-rebase-edit-commit’) +‘r m’ (‘magit-rebase-edit-commit’) Edit a single older commit using rebase. @@ -4191,6 +4414,17 @@ Also see *note (gitman)git-remote:: . Delete a remote, read from the minibuffer. + -- User Option: magit-remote-add-set-branch.pushDefault + + Whether to set the value of ‘branch.pushDefault’ after adding a + remote. + + If ‘ask’, then always ask. If ‘ask-if-unset’, then ask, but only + if the variable isn’t set already. If ‘nil’, then don’t ever set. + If the value is a string, then set without asking, provided the + name of the name of the added remote is equal to that string and + the variable isn’t already set. +  File: magit.info, Node: Fetching, Next: Pulling, Prev: Remotes, Up: Transferring @@ -4204,25 +4438,31 @@ Also see *note (gitman)git-fetch:: . This prefix command shows the following suffix commands along with the appropriate infix arguments in a popup buffer. -‘f f’ (‘magit-fetch-current’) +‘f p’ (‘magit-fetch-from-pushremote’) + + Fetch from the push-remote of the current branch. - Fetch from the upstream repository of the current branch. If - ‘HEAD’ is detached or if the upstream is not configured, then read - the remote. +‘f u’ (‘magit-fetch-from-upstream’) -‘f o’ (‘magit-fetch’) + Fetch from the push-remote of the current branch. + +‘f e’ (‘magit-fetch’) Fetch from another repository. ‘f a’ (‘magit-fetch-all’) - Fetch from all configured remotes. + Fetch from all remotes. ‘f m’ (‘magit-submodule-fetch’) - Fetch all submodules. With a prefix argument fetch all remotes or + Fetch all submodules. With a prefix argument fetch all remotes of all submodules. + Instead of using one popup for fetching and another for pulling, you +could also use ‘magit-pull-and-fetch-popup’. See its doc-string for +more information. +  File: magit.info, Node: Pulling, Next: Pushing, Prev: Fetching, Up: Transferring @@ -4233,16 +4473,24 @@ Also see *note (gitman)git-pull:: . ‘F’ (‘magit-pull-popup’) - This prefix command shows the following suffix commands along with - the appropriate infix arguments in a popup buffer. + This prefix command shows the following suffix commands in a popup + buffer. -‘F F’ (‘magit-pull-current’) +‘F p’ (‘magit-pull-from-pushremote’) - Fetch and merge into current branch. + Pull from the push-remote of the current branch. -‘F o’ (‘magit-pull’) +‘F u’ (‘magit-pull-from-upstream’) - Fetch from another repository and merge a fetched branch. + Pull from the upstream of the current branch. + +‘F e’ (‘magit-pull’) + + Pull from a branch read in the minibuffer. + + Instead of using one popup for fetching and another for pulling, you +could also use ‘magit-pull-and-fetch-popup’. See its doc-string for +more information.  File: magit.info, Node: Pushing, Next: Creating and sending patches, Prev: Pulling, Up: Transferring @@ -4257,37 +4505,33 @@ Also see *note (gitman)git-push:: . This prefix command shows the following suffix commands along with the appropriate infix arguments in a popup buffer. -‘P P’ (‘magit-push-current’) +‘P p’ (‘magit-push-current-to-pushremote’) - Push the current branch to its upstream branch. If the upstream - isn’t set, then read the remote branch. - -‘P o’ (‘magit-push’) + Push the current branch to ‘branch..pushRemote’ or if that is + unset to ‘remote.pushDefault’. - Push a branch to its upstream branch. If the upstream isn’t set, - then read the remote branch. + When ‘magit-push-current-set-remote-if-missing’ is non-nil and the + push-remote is not configured, then read the push-remote from the + user, set it, and then push to it. With a prefix argument the + push-remote can be changed before pushed to it. -‘P e’ (‘magit-push-elsewhere’) +‘P u’ (‘magit-push-current-to-upstream’) - Push a branch or commit to some remote branch. Read the local and - remote branch. + Push the current branch to its upstream branch. -‘P Q’ (‘magit-push-quickly’) + When ‘magit-push-current-set-remote-if-missing’ is non-nil and the + push-remote is not configured, then read the upstram from the user, + set it, and then push to it. With a prefix argument the + push-remote can be changed before pushed to it. - Push the current branch to some remote. When the Git variable - ‘magit.pushRemote’ is set, then push to that remote. If that - variable is undefined or the remote does not exist, then push to - "origin". If that also doesn’t exist then raise an error. The - local branch is pushed to the remote branch with the same name. +‘P e’ (‘magit-push-current’) -‘P i’ (‘magit-push-implicitly’) + Push the current branch to a branch read in the minibuffer. - Push without explicitly specifying what to push. This runs ‘git - push -v’. What is being pushed depends on various Git variables as - described in the *note (gitman)git-push:: and *note - (gitman)git-config:: +‘P o’ (‘magit-push’) - manpages. + Push an arbitrary branch or commit somewhere. Both the source and + the target are read in the minibuffer. ‘P m’ (‘magit-push-matching’) @@ -4305,25 +4549,54 @@ Also see *note (gitman)git-push:: . Push a tag to another repository. - -- User Option: magit-push-always-verify + Two more push commands exist, which by default are not available from +the push popup. See their doc-strings for instructions on how to add +them to the popup. + + -- Command: magit-push-implicitly args + + Push somewhere without using an explicit refspec. + + This command simply runs ‘git push -v [ARGS]’. ARGS are the + arguments specified in the popup buffer. No explicit refspec + arguments are used. Instead the behavior depends on at least these + Git variables: ‘push.default’, ‘branch.pushDefault’, + ‘branch..pushRemote’, ‘branch..remote’, + ‘branch..merge’, and ‘remote..push’. + + -- Command: magit-push-to-remote remote args - Whether certain commands require verification before pushing. + Push to the remote REMOTE without using an explicit refspec. The + remote is read in the minibuffer. - Starting with ‘v2.1.0’ some of the push commands are supposed to - push to the configured upstream branch without requiring user - confirmation or offering to push somewhere else. + This command simply runs ‘git push -v [ARGS] REMOTE’. ARGS are the + arguments specified in the popup buffer. No refspec arguments are + used. Instead the behavior depends on at least these Git + variables: ‘push.default’, ‘branch.pushDefault’, + ‘branch..pushRemote’, ‘branch..remote’, + ‘branch..merge’, and ‘remote..push’. - This has taken a few users by surprise, and they suggested that we - force users to opt-in to this behavior. Unfortunately adding this - option means that now other users will complain about us needlessly - forcing them to set an option. This is an attempt to make everyone - happy and like all such attempts it is prone to fail. Before - complaining about having to set this option, please consider that - other users are less experienced than you and have different needs. + -- User Option: magit-push-current-set-remote-if-missing - You should set the value of this option to nil, causing all push - commands to behave as intended. But first read the description of - each command above. + This option controls whether missing remotes are configured before + pushing. + + When ‘nil’, then the command ‘magit-push-current-to-pushremote’ and + ‘magit-push-current-to-upstream’ do not appear in the push popup if + the push-remote resp. upstream is not configured. If the user + invokes one of these commands anyway, then it raises an error. + + When ‘non-nil’, then these commands always appear in the push + popup. But if the required configuration is missing, then they do + appear in a way that indicates that this is the case. If the user + invokes one of them, then it asks for the necessary configuration, + stores the configuration, and then uses it to push a first time. + + This option also affects whether the argument ‘--set-upstream’ is + available in the popup. If the value is ‘non-nil’, then that + argument is redundant. But note that changing the value of this + option does not take affect immediately, the argument will only be + added or removed after restarting Emacs.  File: magit.info, Node: Creating and sending patches, Next: Applying patches, Prev: Pushing, Up: Transferring @@ -4893,12 +5166,12 @@ example: • ‘/path/to/huge/repo/.git/config’ [include] - path = /path/to/huge-gitconfig + path = /path/to/huge-gitconfig • ‘/path/to/huge-gitconfig’ [status] - showUntrackedFiles = no + showUntrackedFiles = no • ‘$HOME/.emacs.d/init.el’ @@ -4979,7 +5252,7 @@ quite verbosely, allowing these few users to undo the reverts using the ‘undo’ command and then disabling the automatic reverts for the future. Most users should however keep automatic reverts turned on and instead configure it to be less verbose by setting ‘magit-revert-buffers’ to ‘t’ -or even ‘silent’. +or even ‘silent’. This option is mentioned again in the next section.  File: magit.info, Node: Performance, Prev: Safety, Up: Essential settings @@ -5078,10 +5351,24 @@ configuration: Per-repository configuration. many branches and merges. For that reason ‘--color’ is not enabled by default anymore. Consider leaving it at that. + • ‘magit-revert-buffers’ + + After running certain commands, after refreshing the current Magit + buffer, unmodified buffers visiting files belonging to the current + repository are reverted. By default that happens synchronously, + which can be an issue if you visit many buffers. Set this variable + to a number to revert asynchronously. It’s best to use a negative + number because that causes the reverts to happen silently (which is + desirable because the revert messages would otherwise shadow other, + more important messages). + • ‘magit-not-reverted-hook’ • ‘magit-refresh-buffer-hook’ + If third-party packages add functions to these hooks, then you + might want to consider removing them again. + • ‘magit-refs-sections-hook’ When refreshing the "references buffer" is slow, then that’s @@ -5927,7 +6214,7 @@ made it into the manual yet, see * I changed several thousand files at once and now Magit is unusable:: * I am having problems committing:: * I don't like how branching and pushing works:: -* I cannot install the pre-requisits for Magit v2:: +* I cannot install the pre-requisites for Magit v2:: * I am using an Emacs release older than v24.4: I am using an Emacs release older than v244. * I am using a Git release older than v1.9.4: I am using a Git release older than v194. * I am using MS Windows and cannot push with Magit:: @@ -5972,7 +6259,7 @@ emacsclient executable. See *note (with-editor)Configuring With-Editor:: and *note (with-editor)Debugging::.  -File: magit.info, Node: I don't like how branching and pushing works, Next: I cannot install the pre-requisits for Magit v2, Prev: I am having problems committing, Up: FAQ +File: magit.info, Node: I don't like how branching and pushing works, Next: I cannot install the pre-requisites for Magit v2, Prev: I am having problems committing, Up: FAQ A.4 I don’t like how branching and pushing works ================================================ @@ -5982,17 +6269,17 @@ which has taken a few users by surprise and left more unsatisfied. The next release, v2.4, will try to address these concerns.  -File: magit.info, Node: I cannot install the pre-requisits for Magit v2, Next: I am using an Emacs release older than v244, Prev: I don't like how branching and pushing works, Up: FAQ +File: magit.info, Node: I cannot install the pre-requisites for Magit v2, Next: I am using an Emacs release older than v244, Prev: I don't like how branching and pushing works, Up: FAQ -A.5 I cannot install the pre-requisits for Magit v2 -=================================================== +A.5 I cannot install the pre-requisites for Magit v2 +==================================================== An Elpa archive featuring obsolete Magit v1.4.2 and its dependencies is available from . But note that v1.4.2 is obsolete and no longer maintained.  -File: magit.info, Node: I am using an Emacs release older than v244, Next: I am using a Git release older than v194, Prev: I cannot install the pre-requisits for Magit v2, Up: FAQ +File: magit.info, Node: I am using an Emacs release older than v244, Next: I am using a Git release older than v194, Prev: I cannot install the pre-requisites for Magit v2, Up: FAQ A.6 I am using an Emacs release older than v24.4 ================================================ @@ -6088,11 +6375,11 @@ Git release you have installed, and follow the instructions in manual, then instead of following that cross reference show the actual manpage using the function `man'." (let ((node (Info-get-token - (point) "\\*note[ \n\t]+" - "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) + (point) "\\*note[ \n\t]+" + "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) (if (and node (string-match "^(gitman)\\(.+\\)" node)) - (progn (require 'man) - (man (match-string 1 node))) + (progn (require 'man) + (man (match-string 1 node))) ad-do-it))) Or if you are using MS Windows and ‘man’ is not available, use this @@ -6104,11 +6391,11 @@ variation with used the Emacs Lisp implementation provided by the manual, then instead of following that cross reference show the actual manpage using the function `woman'." (let ((node (Info-get-token - (point) "\\*note[ \n\t]+" - "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) + (point) "\\*note[ \n\t]+" + "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) (if (and node (string-match "^(gitman)\\(.+\\)" node)) - (progn (require 'woman) - (woman (match-string 1 node))) + (progn (require 'woman) + (woman (match-string 1 node))) ad-do-it))) Did I mention that texinfo cross reference are just awful? (This is @@ -6272,23 +6559,20 @@ Appendix B Keystroke Index * A a <1>: Cherry picking. (line 43) * A s: Cherry picking. (line 39) * B: Bisecting. (line 8) -* b: Branching. (line 8) +* b: Branching. (line 45) * B b: Bisecting. (line 31) -* b b: Branching. (line 13) -* b B: Branching. (line 29) -* b c: Branching. (line 21) -* b d: Branching. (line 61) -* b e: Branching. (line 83) +* b b: Branching. (line 171) +* b c: Branching. (line 189) +* b d: Branching. (line 229) * B g: Bisecting. (line 36) * B k: Bisecting. (line 41) +* b n: Branching. (line 179) * B r: Bisecting. (line 47) -* b r: Branching. (line 77) +* b r: Branching. (line 235) * B s: Bisecting. (line 16) -* b s: Branching. (line 34) +* b s: Branching. (line 196) * B u: Bisecting. (line 24) -* b u: Branching. (line 67) -* b U: Branching. (line 72) -* b x: Branching. (line 45) +* b x: Branching. (line 213) * c: Initiating a commit. (line 8) * c <1>: Editing rebase sequences. (line 72) @@ -6360,7 +6644,7 @@ Appendix B Keystroke Index (line 89) * d: Diffing. (line 20) * D: Refreshing diffs. (line 11) -* d c: Diffing. (line 75) +* d c: Diffing. (line 67) * d d: Diffing. (line 25) * D f: Refreshing diffs. (line 45) * D g: Refreshing diffs. (line 16) @@ -6369,7 +6653,7 @@ Appendix B Keystroke Index * D r: Refreshing diffs. (line 40) * d s: Diffing. (line 49) * D s: Refreshing diffs. (line 21) -* d t: Diffing. (line 80) +* d t: Diffing. (line 72) * D t: Refreshing diffs. (line 36) * d u: Diffing. (line 55) * d w: Diffing. (line 43) @@ -6394,16 +6678,18 @@ Appendix B Keystroke Index (line 63) * f <1>: Fetching. (line 8) * F: Pulling. (line 8) -* f a: Fetching. (line 23) -* f f: Fetching. (line 13) -* F F: Pulling. (line 13) -* f m: Fetching. (line 27) -* f o: Fetching. (line 19) -* F o: Pulling. (line 17) +* 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) * g: Automatic refresh and revert. - (line 66) + (line 68) * G: Automatic refresh and revert. - (line 75) + (line 77) * j: Diff buffer. (line 38) * k: Viewing Git output. (line 19) * k <1>: Applying. (line 37) @@ -6462,8 +6748,6 @@ Appendix B Keystroke Index * M-x magit-describe-section: Section types and values. (line 13) * M-x magit-describe-section <1>: Matching sections. (line 6) -* M-x magit-diff-unpulled: Diffing. (line 67) -* M-x magit-diff-unpushed: Diffing. (line 63) * 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) @@ -6504,14 +6788,13 @@ Appendix B Keystroke Index * P <1>: Pushing. (line 8) * p <3>: Minor mode for buffers visiting blobs. (line 12) -* P e: Pushing. (line 23) -* P i: Pushing. (line 36) -* P m: Pushing. (line 45) -* P o: Pushing. (line 18) -* P P: Pushing. (line 13) -* P Q: Pushing. (line 28) -* P t: Pushing. (line 51) -* P T: Pushing. (line 57) +* 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) * q: Quitting Windows. (line 6) * q <1>: Log Buffer. (line 12) * q <2>: Blaming. (line 70) @@ -6520,17 +6803,18 @@ Appendix B Keystroke Index * r: Rebasing. (line 8) * r <1>: Editing rebase sequences. (line 51) -* r a: Rebasing. (line 83) -* r e: Rebasing. (line 60) -* r e <1>: Rebasing. (line 79) -* r f: Rebasing. (line 56) -* r i: Rebasing. (line 43) -* r l: Rebasing. (line 47) -* r o: Rebasing. (line 21) -* r r: Rebasing. (line 16) -* r r <1>: Rebasing. (line 71) -* r s: Rebasing. (line 75) -* r w: Rebasing. (line 64) +* r a: Rebasing. (line 84) +* r e: Rebasing. (line 25) +* r e <1>: Rebasing. (line 80) +* r f: Rebasing. (line 57) +* r i: Rebasing. (line 53) +* r m: Rebasing. (line 61) +* r o: Rebasing. (line 31) +* r p: Rebasing. (line 16) +* r r: Rebasing. (line 72) +* r s: Rebasing. (line 76) +* r u: Rebasing. (line 21) +* r w: Rebasing. (line 65) * RET: Diff buffer. (line 6) * RET <1>: References buffer. (line 99) * RET <2>: Blaming. (line 29) @@ -6701,17 +6985,14 @@ Appendix C Command Index (line 45) * magit-blob-previous <1>: Minor mode for buffers visiting blobs. (line 12) -* magit-branch: Branching. (line 21) -* magit-branch-and-checkout: Branching. (line 29) -* magit-branch-delete: Branching. (line 61) -* magit-branch-edit-description: Branching. (line 83) -* magit-branch-popup: Branching. (line 8) -* magit-branch-rename: Branching. (line 77) -* magit-branch-reset: Branching. (line 45) -* magit-branch-set-upstream: Branching. (line 67) -* magit-branch-spinoff: Branching. (line 34) -* magit-branch-unset-upstream: Branching. (line 72) -* magit-checkout: Branching. (line 13) +* magit-branch: Branching. (line 179) +* magit-branch-and-checkout: Branching. (line 189) +* magit-branch-delete: Branching. (line 229) +* 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-checkout-file: Resetting. (line 37) * magit-cherry: Logging. (line 60) * magit-cherry-apply: Cherry picking. (line 22) @@ -6758,8 +7039,6 @@ Appendix C Command Index * magit-diff-staged: Diffing. (line 49) * magit-diff-switch-range-type: Refreshing diffs. (line 40) * magit-diff-toggle-refine-hunk: Refreshing diffs. (line 36) -* magit-diff-unpulled: Diffing. (line 67) -* magit-diff-unpushed: Diffing. (line 63) * magit-diff-unstaged: Diffing. (line 55) * magit-diff-visit-file: Diff buffer. (line 6) * magit-diff-visit-file-worktree: Diff buffer. (line 21) @@ -6779,9 +7058,10 @@ 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 19) -* magit-fetch-all: Fetching. (line 23) -* magit-fetch-current: Fetching. (line 13) +* 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-file-popup: Minor mode for buffers visiting files. (line 19) @@ -6845,37 +7125,40 @@ 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 17) -* magit-pull-current: Pulling. (line 13) +* 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 18) -* magit-push-current: Pushing. (line 13) -* magit-push-elsewhere: Pushing. (line 23) -* magit-push-implicitly: Pushing. (line 36) -* magit-push-matching: Pushing. (line 45) +* 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-quickly: Pushing. (line 28) -* magit-push-tag: Pushing. (line 57) -* magit-push-tags: Pushing. (line 51) -* magit-rebase: Rebasing. (line 16) -* magit-rebase-abort: Rebasing. (line 83) -* magit-rebase-autosquash: Rebasing. (line 56) -* magit-rebase-continue: Rebasing. (line 71) -* magit-rebase-edit: Rebasing. (line 79) -* magit-rebase-edit-commit: Rebasing. (line 60) -* magit-rebase-interactive: Rebasing. (line 43) +* magit-push-tag: Pushing. (line 53) +* magit-push-tags: Pushing. (line 47) +* magit-push-to-remote remote args: Pushing. (line 72) +* magit-rebase: Rebasing. (line 25) +* magit-rebase-abort: Rebasing. (line 84) +* magit-rebase-autosquash: Rebasing. (line 57) +* magit-rebase-continue: Rebasing. (line 72) +* magit-rebase-edit: Rebasing. (line 80) +* magit-rebase-edit-commit: Rebasing. (line 61) +* magit-rebase-interactive: Rebasing. (line 53) +* magit-rebase-onto-pushremote: Rebasing. (line 16) +* magit-rebase-onto-upstream: Rebasing. (line 21) * magit-rebase-popup: Rebasing. (line 8) -* magit-rebase-reword-commit: Rebasing. (line 64) -* magit-rebase-skip: Rebasing. (line 75) -* magit-rebase-subset: Rebasing. (line 21) -* magit-rebase-unpushed: Rebasing. (line 47) +* magit-rebase-reword-commit: Rebasing. (line 65) +* magit-rebase-skip: Rebasing. (line 76) +* magit-rebase-subset: Rebasing. (line 31) * magit-reflog-current: Reflog. (line 11) * magit-reflog-head: Reflog. (line 19) * magit-reflog-other: Reflog. (line 15) * magit-refresh: Automatic refresh and revert. - (line 66) + (line 68) * magit-refresh-all: Automatic refresh and revert. - (line 75) + (line 77) * magit-remote-add: Remotes. (line 13) * magit-remote-popup: Remotes. (line 8) * magit-remote-remove: Remotes. (line 28) @@ -6937,7 +7220,7 @@ Appendix C Command Index (line 38) * magit-shell-command-topdir: Running Git manually. (line 33) -* magit-show-commit: Diffing. (line 75) +* magit-show-commit: Diffing. (line 67) * magit-show-commit <1>: Blaming. (line 29) * magit-show-refs: References buffer. (line 24) * magit-show-refs-current: References buffer. (line 19) @@ -6965,12 +7248,12 @@ Appendix C Command Index * magit-stash-list: Stashing. (line 76) * magit-stash-pop: Stashing. (line 64) * magit-stash-popup: Stashing. (line 8) -* magit-stash-show: Diffing. (line 80) +* magit-stash-show: Diffing. (line 72) * magit-stash-show <1>: Stashing. (line 80) * magit-stash-worktree: Stashing. (line 25) * magit-status: Status buffer. (line 22) * magit-submodule-add: Submodules. (line 13) -* magit-submodule-fetch: Fetching. (line 27) +* magit-submodule-fetch: Fetching. (line 29) * magit-submodule-fetch <1>: Submodules. (line 37) * magit-submodule-init: Submodules. (line 24) * magit-submodule-init <1>: Submodules. (line 41) @@ -7008,164 +7291,3 @@ Appendix C Command Index * with-editor-finish <1>: Editing rebase sequences. (line 6) - -File: magit.info, Node: Function Index, Next: Variable Index, Prev: Command Index, Up: Top - -Appendix D Function Index -************************* - -[index] -* Menu: - -* git-commit-check-style-conventions: Editing commit messages. - (line 247) -* git-commit-propertize-diff: Editing commit messages. - (line 206) -* git-commit-save-message: Editing commit messages. - (line 187) -* git-commit-setup-changelog-support: Editing commit messages. - (line 191) -* git-commit-turn-on-auto-fill: Editing commit messages. - (line 196) -* git-commit-turn-on-flyspell: Editing commit messages. - (line 201) -* ido-enter-magit-status: Status buffer. (line 42) -* magit-add-section-hook: Section hooks. (line 18) -* magit-after-save-refresh-status: Automatic refresh and revert. - (line 84) -* magit-builtin-completing-read: Completion and confirmation. - (line 23) -* magit-call-git: Calling Git for effect. - (line 28) -* magit-call-process: Calling Git for effect. - (line 32) -* magit-cancel-section: Creating sections. (line 70) -* magit-current-section: Section selection. (line 6) -* magit-define-section-jumper: Creating sections. (line 76) -* magit-diff-scope: Matching sections. (line 105) -* magit-diff-type: Matching sections. (line 82) -* magit-display-buffer: Switching Buffers. (line 6) -* magit-display-buffer-traditional: Switching Buffers. (line 37) -* magit-generate-buffer-name-default-function: Naming Buffers. - (line 17) -* magit-get-section: Matching sections. (line 16) -* magit-git: Calling Git for effect. - (line 65) -* magit-git-exit-code: Getting a value from Git. - (line 10) -* magit-git-failure: Getting a value from Git. - (line 19) -* magit-git-false: Getting a value from Git. - (line 29) -* magit-git-insert: Getting a value from Git. - (line 34) -* magit-git-items: Getting a value from Git. - (line 49) -* magit-git-lines: Getting a value from Git. - (line 44) -* magit-git-str: Getting a value from Git. - (line 72) -* magit-git-string: Getting a value from Git. - (line 38) -* magit-git-success: Getting a value from Git. - (line 14) -* magit-git-true: Getting a value from Git. - (line 24) -* magit-git-wash: Calling Git for effect. - (line 70) -* magit-hunk-set-window-start: Section movement. (line 44) -* magit-ido-completing-read: Completion and confirmation. - (line 28) -* magit-insert-am-sequence: Status sections. (line 28) -* magit-insert-bisect-log: Status sections. (line 46) -* magit-insert-bisect-output: Status sections. (line 38) -* magit-insert-bisect-rest: Status sections. (line 42) -* magit-insert-head-header: Status header sections. - (line 27) -* magit-insert-heading: Creating sections. (line 41) -* magit-insert-local-branches: References sections. (line 17) -* magit-insert-merge-log: Status sections. (line 18) -* magit-insert-rebase-sequence: Status sections. (line 23) -* magit-insert-recent-commits: Status sections. (line 91) -* magit-insert-remote-branches: References sections. (line 21) -* magit-insert-remote-header: Status header sections. - (line 45) -* magit-insert-repo-header: Status header sections. - (line 41) -* magit-insert-section: Creating sections. (line 6) -* magit-insert-sequencer-sequence: Status sections. (line 33) -* magit-insert-staged-changes: Status sections. (line 59) -* magit-insert-stashes: Status sections. (line 63) -* magit-insert-status-headers: Status header sections. - (line 11) -* magit-insert-tags: References sections. (line 25) -* magit-insert-tags-header: Status header sections. - (line 35) -* magit-insert-tracked-files: Status sections. (line 80) -* magit-insert-unpulled-cherries: Status sections. (line 102) -* magit-insert-unpulled-commits: Status sections. (line 70) -* magit-insert-unpulled-module-commits: Status sections. (line 109) -* magit-insert-unpulled-or-recent-commits: Status sections. (line 84) -* magit-insert-unpushed-cherries: Status sections. (line 114) -* magit-insert-unpushed-commits: Status sections. (line 74) -* magit-insert-unpushed-module-commits: Status sections. (line 122) -* magit-insert-unstaged-changes: Status sections. (line 55) -* magit-insert-untracked-files: Status sections. (line 50) -* magit-insert-upstream-header: Status header sections. - (line 31) -* magit-insert-user-header: Status header sections. - (line 53) -* magit-log-maybe-show-more-commits: Section movement. (line 57) -* magit-log-maybe-update-blob-buffer: Section movement. (line 69) -* magit-log-maybe-update-revision-buffer: Section movement. (line 63) -* magit-maybe-set-dedicated: Switching Buffers. (line 66) -* magit-mode-display-buffer: Refreshing buffers. (line 32) -* magit-mode-quit-window: Quitting Windows. (line 31) -* magit-mode-setup: Refreshing buffers. (line 17) -* magit-region-sections: Section selection. (line 10) -* magit-region-values: Section selection. (line 29) -* magit-restore-window-configuration: Quitting Windows. (line 20) -* magit-revert-buffers: Editing commit messages. - (line 178) -* magit-run-git: Calling Git for effect. - (line 36) -* magit-run-git-async: Calling Git for effect. - (line 80) -* magit-run-git-with-editor: Calling Git for effect. - (line 93) -* magit-run-git-with-input: Calling Git for effect. - (line 40) -* magit-run-git-with-logfile: Calling Git for effect. - (line 56) -* magit-save-window-configuration: Switching Buffers. (line 55) -* magit-section-case: Matching sections. (line 58) -* magit-section-hide: Section visibility. (line 51) -* magit-section-hide-children: Section visibility. (line 66) -* magit-section-ident: Matching sections. (line 11) -* magit-section-match: Matching sections. (line 21) -* magit-section-set-window-start: Section movement. (line 50) -* magit-section-show: Section visibility. (line 47) -* magit-section-show-children: Section visibility. (line 60) -* magit-section-show-headings: Section visibility. (line 55) -* magit-section-show-level-1: Section visibility. (line 26) -* magit-section-show-level-1-all: Section visibility. (line 34) -* magit-section-show-level-2: Section visibility. (line 27) -* magit-section-show-level-2-all: Section visibility. (line 35) -* magit-section-show-level-3: Section visibility. (line 28) -* magit-section-show-level-3-all: Section visibility. (line 36) -* magit-section-show-level-4: Section visibility. (line 29) -* magit-section-show-level-4-all: Section visibility. (line 37) -* magit-section-toggle-children: Section visibility. (line 70) -* magit-section-when: Matching sections. (line 48) -* magit-start-git: Calling Git for effect. - (line 105) -* magit-start-process: Calling Git for effect. - (line 124) -* magit-status-maybe-update-blob-buffer: Section movement. (line 81) -* magit-status-maybe-update-revision-buffer: Section movement. - (line 75) -* magit-wip-log: Wip modes. (line 69) -* magit-wip-log-current: Wip modes. (line 77) -* with-editor-usage-message: Editing commit messages. - (line 215) - diff --git a/elpa/magit-20151223.1425/magit.info-2 b/elpa/magit-20151223.1425/magit.info-2 new file mode 100644 index 0000000000000000000000000000000000000000..b53236baaeb53a6db51190daf7ea65e36f5df9ee GIT binary patch literal 21336 zcmc&+TW{M&7VcxAKe6-J6rneg?f9}qu}X}&BTi?S*fZ6X(9zQyYwCA}&>$*N9^ zTpSk)kO?vzFbXNs%{Ik%@X+H*zChrOjiJ zZputp1|{;OIf8dC-%|9Z4JIn@EN?kEUFDYyD9319udWo z*ppUb5vSR9z@{dyKh|P_V!v)%82^O6IbPGx4^aXK5mSP7|5ePzmS^y;85W;*#RMtfUmT z#j?4NE2)8A7Ql}iX!2tr!AyLW)$Btf5DN+3RpL8n%(iGNQIz!1BaK1~&tlMLAGXZ8 zbIwNR?9L5M%hj>gMM+EmFiv})LJ`1z=*hCp9&328NxZ+h`{~WQJ8^OSLA<}Xxw*K$ z`|uBZyjd4`SLqrZk?beMiE+Xz&YLaHpfO%w-aP*a4_!RF`uXba1D)mN)!p^w?X7tE z=0;qIw-+~eSI^)5d~qY*zPow*=JxVH+=5?(3O;L;JSL4mHqS=*rdg%Qw-B ztDETd^7-A>n`>>xliNFdOVqu2d3|^DVe-A!$8+(W@;Z;8$m-9#I?Y$gYLtV~j(|?A zKYuW}ynfNgn*43@5(aGUQBEcoWhwJT`dPf_Ax^&E_h&Ns=G*_I^sV1~`(HY*%-iz`{;^7% zi2MotwU)`psBX5I#7jAx2hm!e6DuwkX+ylw9~B!}*Kmelvu4zv{r`6vIf>cP$s?B( zI6%0kCjFm`V1-LXg8hzhNqO?LM@k)kl94&DL&w-$nV$B!Qp=_-A*MKA$*fpKbz8za zLV-pnt$JC^+vQSL*1>4~7e_NP(7kfCN*Tg`_mn;zYl;8^i@pSdbzPgfJ4-3Bn40nu+{%+$6|kS7Lay>67E# z(I_58&2}#iQiHuf;*>EPiCCG%+emu^4^_9wG&D)il+)nMc6j6fMNJh`utoxGopK21 zPz4!np(~ZhHqww3Z{A>@W|y$ik^f&Ab_-yWpvcz3+3s587)1&plEIcIV00@$Z`lpOPlOXA;#91X-`H?)$TRvv1yt0Xt|H;^&Sb0 zoaOP9Xx-*0u4NP5qYN+ZDHnGgjZKL*=>1V6N~QL;Kww9rdSh=6O-Aq)@@S@c+G9rX z28a8tr9NYi*QW5{X;qi%@if=~%~Sehg!;CJV=E{x&=HIJE)beiW$R}7A&R(Bxj?9( zT$rw=^Han;g#l8jBZ_6J%ho7;cA2c9NWZwtKp!Ud^AyieBCD$C)1dw5sFciDl4mHP zBS&*|3X}EMtaM$_i9;=1gwTypgE=$wca%jBVA!6JSHpMpi57 zvxJ~2@E(8xDq9r)U!TdxEa^0qRB|5IRL>1uMaU?5-QEGA%WhkjPG%ASnm%C-fDUL= zP|2fI&=FTiTC<`4R8j%ChOLZhRGZ>eMt7vL=oynXZmT!r_?f3eo*2*A_v93$0-Xe2 z+?pdn2{wg=wOGsoscVmJVBrFb!Kf`eJx&ne2@UPrVeOUufjz zqi7syO^4C~Yn<=52NEJ^3ardEydj{!Kmm_ElvEhoLf(kFJz0hH=4=?d+q}eNQE3i> zXUf0=KvSL;8{Tw4G*XJlGi%3j9@LwY;n7^6wnQl+;|-ZwfFi+D(mq8PdA4fyL*pRQ zgaFXg;{iL0kXv9z?D%I7l*w&%L*EI-1Vm#~8cBUQvuDE`umk!-N8^P!piZ_!|E>K_LxYE9SFaX1c5vh85JC68U|<_M|R|4GMYGl zf&V#S&Yk9Sn|M1%uCqq9N3&_F+Kge5k(x1%uiQIkdGZdZEwLwnOeHJkylET)ddlL~ z00@(wls0HOFdvdJQXaR=u~5n`utkx8CN{*Om=WqXKV?P=qon!n{x&$m4$ZBo+pN3f z)B-mY@wtTp`mIGjMi*Qp7WOm2s<8 zh$O|X%np4YTmbMD>d*_LrDxPB%o%gamM4mm6iG(Ep))EaNBejJ z&rJEL!<11eIc9pI76kU1ARJA|oAY$Sc$O$Zf$to}I;+ss?wHw-1zM;6QCSx{DSXY- zEN!;CuyD+LCkH|*nPv+#UpQ&jQ~7{+pt3+9DDSI`I$h{!ywI{h8=4VwO1^|gJma=N zdmGC3Xx{XKDPjkNEX7AqklA`~OQ-G}=#Mjd4@D}8Lzr}&x;>gtYCeTj30Q`;mMoe& zM+^b+V!}C^0gA94(t(A5croDtnsp$g0wEyYJoN#6IYlgC_5dAzIYl0$Wz0VOa*DV= z(s{8?n>DkKzMLYK?|P1Q^yL(>4BP@W#cD<6@xYPXnpEDWki6cuK=*6c4O!z4?ll~7 zX4C8_lxK_?J)CVA)S#dwu)H)XC4ABcN~n#dixXd|WToWuh^IVicz}MtRC<_E4R7<@ zr=_>|-)YPHw4^O{Y~gkXEOm=o+Whrz#EzP0&!+HO zq3!BDYt)0K>){^tWp4%hPwY|a`N0A0!`{-G?rWOe3|ak5jTw4{pDz2RGv$~2KsRb) zGC&Fe>2*>Abbayq@&HPbRH?c!&_@aY37tE0AT^TeLumC20qL;JfvB#%Q4^B^S_tSw zId~4FCrSelqA3LQROz(~MDv?J4y0TM?O*8jj@pLCzq5AZdu11wNBYjZ2E2yf9Ke=EZ#;m9=cKzMva{T~aqHDN`LJ7%7|hS2U=}a}I?)E-AW; z#z;}ECjXlExV!7q6SYyoNojH01ZuL0KS!C&R}HIAM&-(Erlu`KikS|pO9k=b6Kx~+ zMPy0QAH^7550W3~CW<)g*kWigTj;22X*JrVW?WjPPx^dOxitn7Sgum{13CkOZyA>s zai+4*6l%_VDK8% z_%|M$4TE_`3)HIu?b}4HfA#NkJi`Zixj>h}ov{i;1CiInrz5(x8M|$W5YQ=WfN3D5 zM+S}S5QWSTMU2%Ns7Y}?4>`XBq%SsUEz%Jf6$Guum@aq32V;RCZtjgaKy;;~dmgd4 z>Xx>GK>TQG*bDe6@Y3)MF~)Qx70s}AhZ zbi~liHbA(&h>M6378Wt3rCAPULHdM2AXcOspi15s)gK1pnr(pU-&(9?ApKHzhd8%G z6mf+F5Wk)@l-%>tuPO0qi`p4ndak>YD znJ+r0e04bp#P&}WP>H+kn6|C4qh8}?yc4EFK>T)w0)pMs1s`&cTw2PgLO^^+$Q>aL zB^GR9bNlE4<%OPw?Fb9?!uhU;RA*bGCSz%*Qpy!h0OfJ~MYS1a{{0z0A8 z(O#((O5G{%KJY-P5SJ1S`&AlEiwBKtOBxVNIwydqcVryMIO_yIeXz@843POUgQS6`PgwI)0jZq|(34s>NTirQ!K1OPssn-#Qdiw{ z{#ffm2uuqB=|+T(hB+_q{6cyiK~ z)yx+vAb#JVXIXr4cK~$4rfv$z2;7upu8jsMV$)j%WPP}6Tbfl2$bPIVF}T;zK;-AW z(ZbnD9vsbGGXk?!7KZ+oFJLf=20+fv21!k=HoL6pR3HT88i+D1{Ywx2qE5HQZ8%lm zV8qY&-m0$dgEOLEWh$J_p)DIePRvt5{#bWceOm z7kA7aZ-rmwqOeHXrTpxT2~5rpa~KZsgsKBlnzX9oPccTH%vFbgcpg+02+v0I+2frO z1&6>qqc^|o(Fsn=h9zh_R?|n_oRwReAqKrXeerN$wYPy))k9WdS|AD@yIDAcvp~By zL6voDOdUHQW&Sj8hZAseMMII3by}%$iu5ek%o`Xbmfc3L^#^vBvL0rd%M}rM4~?gx zcPcgxW0|4EIg#ZJS40D3ScGd9{ojZ&K=uP#?uIv95$RXYLX-PZR~4uH!e*PNsBo8E zvy75)rpMvhlxJmT>|fBYsM)pB1uVYXzqJZzRb4U1Dj+KjRI8eV6(w{}X;?u8T>X^h z)b`hWX!fqlinuH@Ojr6-r_k*EjA^nD2uTBaLgp4}0BFiDDei!j1JTKY+I#NMJW!fP z(?iCi9?;-q!UNM;JKxGApt(d$rQI6(ZL2<)0zgyl$oxQzOCcbBjevlZ682kL)@=lV il+@_9&_Q4}ZIA*@X*2)PN!g&~YbmjRhk(@L#Qy; ;; Maintainer: Jonas Bernoulli -;; Package-Requires: ((emacs "24.4") (dash "2.10.0")) +;; Package-Requires: ((emacs "24.4") (async "20150909.2257") (dash "20151021.113")) ;; Keywords: tools ;; Homepage: https://github.com/magit/magit @@ -40,7 +40,7 @@ ;; export `$EDITOR' making sure the executed command uses the current ;; Emacs instance as "the editor". With a prefix argument these ;; commands prompt for an alternative environment variable such as -;; `$GIT_EDITOR'. To always use these variants add this to you init +;; `$GIT_EDITOR'. To always use these variants add this to your init ;; file: ;; ;; (define-key (current-global-map) @@ -84,6 +84,11 @@ (require 'tramp) (require 'tramp-sh nil t) +(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)) + (eval-when-compile (progn (require 'dired nil t) (require 'eshell nil t) @@ -103,7 +108,7 @@ (defun with-editor-locate-emacsclient () "Search for a suitable Emacsclient executable." (--if-let (with-editor-locate-emacsclient-1 (with-editor-emacsclient-path) 3) - (shell-quote-argument it) + it (display-warning 'with-editor (format "\ Cannot determine a suitable Emacsclient @@ -121,7 +126,7 @@ please see https://github.com/magit/magit/wiki/Emacsclient.")) (lambda (v) (cl-mapcar (lambda (e) (concat v e)) exec-suffixes)) (nconc (cl-mapcon (lambda (v) (setq v (mapconcat #'identity (reverse v) ".")) - (list v (concat "-" v))) + (list v (concat "-" v) (concat ".emacs" v))) (reverse version-lst)) (list ""))) (lambda (exec) @@ -132,7 +137,8 @@ please see https://github.com/magit/magit/wiki/Emacsclient.")) (with-editor-locate-emacsclient-1 path (1- depth)))))) (defun with-editor-emacsclient-version (exec) - (cadr (split-string (car (process-lines exec "--version"))))) + (-when-let (1st-line (car (process-lines exec "--version"))) + (cadr (split-string 1st-line)))) (defun with-editor-emacsclient-path () (let ((path exec-path)) @@ -165,7 +171,7 @@ sleep 604800 & sleep=$!; \ trap \"kill $sleep; exit 0\" USR1; \ trap \"kill $sleep; exit 1\" USR2; \ wait $sleep'" - "The looping editor, used when the Emacsclient cannot be used. + "The sleeping editor, used when the Emacsclient cannot be used. This fallback is used for asynchronous process started inside the macro `with-editor', when the process runs on a remote machine or @@ -229,11 +235,14 @@ not a good idea to change such entries.") (defvar with-editor-pre-finish-hook nil) (defvar with-editor-pre-cancel-hook nil) +(defvar with-editor-post-finish-hook nil) +(defvar with-editor-post-finish-hook-1 nil) (defvar with-editor-post-cancel-hook nil) (defvar with-editor-post-cancel-hook-1 nil) (defvar with-editor-cancel-alist nil) (put 'with-editor-pre-finish-hook 'permanent-local t) (put 'with-editor-pre-cancel-hook 'permanent-local t) +(put 'with-editor-post-finish-hook 'permanent-local t) (put 'with-editor-post-cancel-hook 'permanent-local t) (defvar with-editor-show-usage t) @@ -253,8 +262,12 @@ not a good idea to change such entries.") (interactive "P") (when (run-hook-with-args-until-failure 'with-editor-finish-query-functions force) - (run-hooks 'with-editor-pre-finish-hook) - (with-editor-return nil))) + (let ((with-editor-post-finish-hook-1 + (ignore-errors (delq t with-editor-post-finish-hook)))) + (run-hooks 'with-editor-pre-finish-hook) + (with-editor-return nil) + (accept-process-output nil 0.1) + (run-hooks 'with-editor-post-finish-hook-1)))) (defun with-editor-cancel (force) "Cancel the current edit session." @@ -287,10 +300,17 @@ not a good idea to change such entries.") (ignore-errors (server-send-string client "-error Canceled by user")) (delete-process client)) + ;; Fallback for when emacs was used as $EDITOR instead + ;; of emacsclient or the sleeping editor. See #2258. + (ignore-errors (delete-file buffer-file-name)) (kill-buffer))) (t (save-buffer) - (if clients (server-edit) (kill-buffer)))) + (if clients + ;; Don't use `server-edit' because we do not want to show + ;; another buffer belonging to another client. See #2197. + (server-done) + (kill-buffer)))) (when pid (let ((default-directory dir)) (process-file "kill" nil nil nil @@ -321,7 +341,7 @@ not a good idea to change such entries.") (error "With-Editor mode cannot be turned off")) (add-hook 'kill-buffer-query-functions 'with-editor-kill-buffer-noop nil t) - ;; `server-excecute' displays a message which is not + ;; `server-execute' displays a message which is not ;; correct when using this mode. (when with-editor-show-usage (with-editor-usage-message))) @@ -352,7 +372,7 @@ Modify the `process-environment' for processes started in BODY, instructing them to use the Emacsclient as $EDITOR. If optional ENVVAR is provided then bind that environment variable instead. \n(fn [ENVVAR] BODY...)" - (declare (indent defun)) + (declare (indent defun) (debug (body))) `(let ((with-editor--envvar ,(if (stringp (car body)) (pop body) '(or with-editor--envvar "EDITOR"))) @@ -372,16 +392,17 @@ ENVVAR is provided then bind that environment variable instead. (server-start)) ;; Tell $EDITOR to use the Emacsclient. (setenv with-editor--envvar - (concat with-editor-emacsclient-executable + (concat (shell-quote-argument with-editor-emacsclient-executable) ;; Tell the process where the server file is. (and (not server-use-tcp) (concat " --socket-name=" - (expand-file-name server-name - server-socket-dir))))) + (shell-quote-argument + (expand-file-name server-name + server-socket-dir)))))) (when server-use-tcp (setenv "EMACS_SERVER_FILE" (expand-file-name server-name server-auth-dir))) - ;; As last resort fallback to the looping editor. + ;; As last resort fallback to the sleeping editor. (setenv "ALTERNATE_EDITOR" with-editor-sleeping-editor)) ,@body)) @@ -391,14 +412,22 @@ ENVVAR is provided then bind that environment variable instead. with-editor-server-window-alist))) server-window)) -(defadvice server-switch-buffer (around with-editor activate) +(defun server-switch-buffer--with-editor-server-window-alist + (fn &optional next-buffer killed-one filepos) "Honor `with-editor-server-window-alist' (which see)." (let ((server-window (with-current-buffer (or next-buffer (current-buffer)) + (when with-editor-mode + (setq with-editor-previous-winconf + (current-window-configuration))) (with-editor-server-window)))) - ad-do-it)) + (funcall fn next-buffer killed-one filepos))) + +(advice-add 'server-switch-buffer :around + 'server-switch-buffer--with-editor-server-window-alist) -(defadvice start-file-process (around with-editor activate) +(defun start-file-process--with-editor-process-filter + (fn name buffer program &rest program-args) "When called inside a `with-editor' form and the Emacsclient cannot be used, then give the process the filter function `with-editor-process-filter'. To avoid overriding the filter @@ -408,23 +437,22 @@ instead of `set-process-filter' inside `with-editor' forms. When the `default-directory' is located on a remote machine, then also manipulate PROGRAM and PROGRAM-ARGS in order to set the appropriate editor environment variable." - ;; (fn NAME BUFFER PROGRAM &rest PROGRAM-ARGS) (if (not with-editor--envvar) - ad-do-it + (apply fn name buffer program program-args) (when (file-remote-p default-directory) - (let ((prog (ad-get-arg 2)) - (args (ad-get-args 3))) - (unless (equal program "env") - (push prog args) - (setq prog "env")) - (push (concat with-editor--envvar "=" with-editor-sleeping-editor) args) - (ad-set-arg 2 prog) - (ad-set-args 3 args))) - (let ((process ad-do-it)) + (unless (equal program "env") + (push program program-args) + (setq program "env")) + (push (concat with-editor--envvar "=" with-editor-sleeping-editor) + program-args)) + (let ((process (apply fn name buffer program program-args))) (set-process-filter process 'with-editor-process-filter) (process-put process 'default-dir default-directory) process))) +(advice-add 'start-file-process :around + 'start-file-process--with-editor-process-filter) + (defun with-editor-set-process-filter (process filter) "Like `set-process-filter' but keep `with-editor-process-filter'. Give PROCESS the new FILTER but keep `with-editor-process-filter' @@ -442,6 +470,8 @@ which may or may not insert the text into the PROCESS' buffer." (with-editor-process-filter proc str t)) filter))) +(defvar with-editor-filter-visit-hook nil) + (defun with-editor-output-filter (string) (save-match-data (if (string-match "^WITH-EDITOR: \\([0-9]+\\) OPEN \\(.+?\\)\r?$" string) @@ -586,7 +616,7 @@ else like the former." (defun with-editor-shell-command-read-args (prompt &optional async) (let ((command (read-shell-command prompt nil nil - (--when-let (or (buffer-file-name) + (--when-let (or buffer-file-name (and (eq major-mode 'dired-mode) (dired-get-filename nil t))) (file-relative-name it))))) @@ -597,25 +627,32 @@ else like the former." shell-command-default-error-buffer (and async current-prefix-arg (with-editor-read-envvar))))) -(defadvice shell-command (around with-editor activate) +(defun shell-command--shell-command-with-editor-mode + (fn command &optional output-buffer error-buffer) (cond ((or (not (or with-editor--envvar shell-command-with-editor-mode)) - (not (string-match-p "&$" (ad-get-arg 0)))) - ad-do-it) + (not (string-match-p "&\\'" command))) + (funcall fn command output-buffer error-buffer)) ((and with-editor-emacsclient-executable (not (file-remote-p default-directory))) - (with-editor ad-do-it)) + (with-editor (funcall fn command output-buffer error-buffer))) (t - (ad-set-arg - 0 (format "%s=%s %s" - (or with-editor--envvar "EDITOR") - (shell-quote-argument with-editor-sleeping-editor) - (ad-get-arg 0))) - (let ((process ad-do-it)) - (set-process-filter - process (lambda (proc str) - (comint-output-filter proc str) - (with-editor-process-filter proc str t))) - process)))) + (apply fn (format "%s=%s %s" + (or with-editor--envvar "EDITOR") + (shell-quote-argument with-editor-sleeping-editor) + command) + output-buffer error-buffer) + (ignore-errors + (let ((process (get-buffer-process + (or output-buffer + (get-buffer "*Async Shell Command*"))))) + (set-process-filter + process (lambda (proc str) + (comint-output-filter proc str) + (with-editor-process-filter proc str t))) + process))))) + +(advice-add 'shell-command :around + 'shell-command--shell-command-with-editor-mode) ;;; with-editor.el ends soon @@ -642,7 +679,7 @@ See `with-editor.info' for instructions." (format " server-use-tcp: %s\n" server-use-tcp) (format " server-name: %s\n" server-name) (format " server-socket-dir: %s\n" server-socket-dir)) - (if (file-accessible-directory-p server-socket-dir) + (if (and server-socket-dir (file-accessible-directory-p server-socket-dir)) (--each (directory-files server-socket-dir nil "^[^.]") (insert (format " %s\n" it))) (insert (format " %s: not an accessible directory\n" @@ -672,7 +709,7 @@ See `with-editor.info' for instructions." (--each (with-editor-emacsclient-path) (insert (format " %s (%s)\n" it (car (file-attributes it)))) (when (file-directory-p it) - (dolist (exec (directory-files it nil "emacsclient")) + (dolist (exec (directory-files it t "emacsclient")) (insert (format " %s (%s)\n" exec (with-editor-emacsclient-version exec)))))))) diff --git a/elpa/with-editor-20150701.1246/with-editor.info b/elpa/with-editor-20151223.1341/with-editor.info similarity index 97% rename from elpa/with-editor-20150701.1246/with-editor.info rename to elpa/with-editor-20151223.1341/with-editor.info index ecab503f..ea246fa9 100644 --- a/elpa/with-editor-20150701.1246/with-editor.info +++ b/elpa/with-editor-20151223.1341/with-editor.info @@ -180,7 +180,7 @@ File: with-editor.info, Node: Using With-Editor commands, Prev: Configuring Wi 1.2 Using With-Editor commands ============================== -This section describes how to use the with-editor library _outside_ of +This section describes how to use the ‘with-editor’ library _outside_ of Magit. You don’t need to know any of this just to create commits using Magit. @@ -232,7 +232,7 @@ to be used as editor by adding it to the appropriate mode hooks: Some variants of this function exist; these two forms are equivalent: (add-hook 'shell-mode-hook - (apply-partially 'with-editor-export-editor "GIT_EDITOR")) + (apply-partially 'with-editor-export-editor "GIT_EDITOR")) (add-hook 'shell-mode-hook 'with-editor-export-git-editor) -- Command: with-editor-export-editor @@ -259,7 +259,7 @@ This section describes how to use the with-editor library _outside_ of Magit to teach another package how to have its child processes call home, just like Magit does. You don’t need to know any of this just to create commits using Magit. You can also ignore this if you use -with-editor outside of Magit, but only as an end-user. +‘with-editor’ outside of Magit, but only as an end-user. For information about interactive use and options which affect both interactive and non-interactive use, see *note Using the With-Editor @@ -312,8 +312,8 @@ Node: Top1540 Node: Using the With-Editor package3227 Node: Configuring With-Editor3843 Node: Using With-Editor commands7450 -Node: Using With-Editor as a library10614 -Node: Debugging12280 +Node: Using With-Editor as a library10613 +Node: Debugging12285  End Tag Table diff --git a/elpa/with-editor-readme.txt b/elpa/with-editor-readme.txt new file mode 100644 index 00000000..7c6c5597 --- /dev/null +++ b/elpa/with-editor-readme.txt @@ -0,0 +1,46 @@ +Use the Emacsclient as `$EDITOR' of child processes, making sure +they know how to call home. For remote processes a substitute is +provided, which communicates with Emacs on stdout instead of using +a socket as the Emacsclient does. + +The commands `with-editor-async-shell-command' and +`with-editor-shell-command' are intended as drop in replacements +for `async-shell-command' and `shell-command'. They automatically +export `$EDITOR' making sure the executed command uses the current +Emacs instance as "the editor". With a prefix argument these +commands prompt for an alternative environment variable such as +`$GIT_EDITOR'. To always use these variants add this to your init +file: + + (define-key (current-global-map) + [remap async-shell-command] 'with-editor-async-shell-command) + (define-key (current-global-map) + [remap shell-command] 'with-editor-shell-command) + +Alternatively use the global `shell-command-with-editor-mode', +which always sets `$EDITOR' for all Emacs commands which ultimately +use `shell-command' to asynchronously run some shell command. + +The command `with-editor-export-editor' exports `$EDITOR' or +another such environment variable in `shell-mode', `term-mode' and +`eshell-mode' buffers. Use this Emacs command before executing a +shell command which needs the editor set, or always arrange for the +current Emacs instance to be used as editor by adding it to the +appropriate mode hooks: + + (add-hook 'shell-mode-hook 'with-editor-export-editor) + (add-hook 'term-mode-hook 'with-editor-export-editor) + (add-hook 'eshell-mode-hook 'with-editor-export-editor) + +Some variants of this function exist, these two forms are +equivalent: + + (add-hook 'shell-mode-hook + (apply-partially 'with-editor-export-editor "GIT_EDITOR")) + (add-hook 'shell-mode-hook 'with-editor-export-git-editor) + +This library can also be used by other packages which need to use +the current Emacs instance as editor. In fact this library was +written for Magit and its `git-commit-mode' and `git-rebase-mode'. +Consult `git-rebase.el' and the related code in `magit-sequence.el' +for a simple example. -- 2.47.3