Commit 544d428b authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-gitignore-globally: New command

Replace `magit-gitignore', which ignored locally with a prefix
argument, with `magit-gitignore-globally', which always ignores
globally.

Replace `magit-gitignore's binding ("i") in `magit-mode-map' with
a second binding for `magit-gitignore-popup' (the other one being
"I").

The popup is more convenient than the old command with a prefix
argument.
parent 475b6597
......@@ -8,7 +8,7 @@
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: Magit: (magit).
#+TEXINFO_DIR_DESC: Using Git from Emacs with Magit.
#+SUBTITLE: for version 2.13.0 (2.13.0-296-geb609b267+1)
#+SUBTITLE: for version 2.13.0 (2.13.0-297-g475b65975+1)
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-version-strings
#+TEXINFO_DEFFN: t
......@@ -23,7 +23,7 @@ directly from within Emacs. While many fine Git clients exist, only
Magit and Git itself deserve to be called porcelains.
#+TEXINFO: @noindent
This manual is for Magit version 2.13.0 (2.13.0-296-geb609b267+1).
This manual is for Magit version 2.13.0 (2.13.0-297-g475b65975+1).
#+BEGIN_QUOTE
Copyright (C) 2015-2018 Jonas Bernoulli <jonas@bernoul.li>
......
......@@ -31,7 +31,7 @@ General Public License for more details.
@finalout
@titlepage
@title Magit User Manual
@subtitle for version 2.13.0 (2.13.0-296-geb609b267+1)
@subtitle for version 2.13.0 (2.13.0-297-g475b65975+1)
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
......@@ -53,7 +53,7 @@ directly from within Emacs. While many fine Git clients exist, only
Magit and Git itself deserve to be called porcelains.
@noindent
This manual is for Magit version 2.13.0 (2.13.0-296-geb609b267+1).
This manual is for Magit version 2.13.0 (2.13.0-297-g475b65975+1).
@quotation
Copyright (C) 2015-2018 Jonas Bernoulli <jonas@@bernoul.li>
......
......@@ -245,16 +245,14 @@ with two prefix arguments remove ignored files only.
"Popup console for gitignore commands."
:man-page "gitignore"
:actions '((?l "ignore locally" magit-gitignore-locally)
(?g "ignore globally" magit-gitignore))
(?g "ignore globally" magit-gitignore-globally))
:max-action-columns 1)
;;;###autoload
(defun magit-gitignore (file-or-pattern &optional local)
"Instruct Git to globally ignore FILE-OR-PATTERN.
With a prefix argument ignore locally instead."
(interactive (list (magit-gitignore-read-pattern current-prefix-arg)
current-prefix-arg))
(magit--gitignore file-or-pattern local))
(defun magit-gitignore-globally (file-or-pattern)
"Instruct Git to globally ignore FILE-OR-PATTERN."
(interactive (list (magit-gitignore-read-pattern nil)))
(magit--gitignore file-or-pattern nil))
;;;###autoload
(defun magit-gitignore-locally (file-or-pattern)
......
......@@ -390,7 +390,7 @@ starts complicating other things, then it will be removed."
(define-key map (kbd "P") 'magit-push-popup)
(define-key map (kbd "k") 'magit-delete-thing)
(define-key map (kbd "K") 'magit-file-untrack)
(define-key map (kbd "i") 'magit-gitignore)
(define-key map (kbd "i") 'magit-gitignore-popup)
(define-key map (kbd "I") 'magit-gitignore-popup)))
(define-key map (kbd "SPC") 'magit-diff-show-or-scroll-up)
(define-key map (kbd "DEL") 'magit-diff-show-or-scroll-down)
......@@ -519,7 +519,7 @@ which visits the thing at point using `browse-url'."
["Cherry pick" magit-cherry-pick t]
["Revert commit" magit-revert-popup t]
"---"
["Ignore" magit-gitignore t]
["Ignore globally" magit-gitignore-globally t]
["Ignore locally" magit-gitignore-locally t]
["Discard" magit-discard t]
["Reset head and index" magit-reset-mixed t]
......
......@@ -32,6 +32,7 @@
;;; Obsolete since v2.90.0
(define-obsolete-function-alias 'magit-reset-head 'magit-reset-mixed "Magit 2.90.0")
(define-obsolete-function-alias 'magit-gitignore 'magit-gitignore-globally "Magit 2.90.0")
;;; _
(provide 'magit-obsolete)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment