Commit 475b6597 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit--gitignore: New function

parent eb609b26
......@@ -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-295-g371b80c56+1)
#+SUBTITLE: for version 2.13.0 (2.13.0-296-geb609b267+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-295-g371b80c56+1).
This manual is for Magit version 2.13.0 (2.13.0-296-geb609b267+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-295-g371b80c56+1)
@subtitle for version 2.13.0 (2.13.0-296-geb609b267+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-295-g371b80c56+1).
This manual is for Magit version 2.13.0 (2.13.0-296-geb609b267+1).
@quotation
Copyright (C) 2015-2018 Jonas Bernoulli <jonas@@bernoul.li>
......
......@@ -250,10 +250,19 @@ with two prefix arguments remove ignored files only.
;;;###autoload
(defun magit-gitignore (file-or-pattern &optional local)
"Instruct Git to ignore FILE-OR-PATTERN.
With a prefix argument only ignore locally."
"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))
;;;###autoload
(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 (file-or-pattern local)
(let ((gitignore
(if local
(magit-git-dir (convert-standard-filename "info/exclude"))
......@@ -272,12 +281,6 @@ With a prefix argument only ignore locally."
(magit-refresh)
(magit-run-git "add" ".gitignore"))))
;;;###autoload
(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-pattern (local)
(let* ((default (magit-current-file))
(choices
......
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