From 56fcfdbea0014eb93c44d17337a357164fd8d89b Mon Sep 17 00:00:00 2001
From: CNA-Bld <cna.bld@gmail.com>
Date: Mon, 27 Jul 2015 18:51:53 +0800
Subject: [PATCH] update documentation

---
 share/doc/homebrew/brew-tap.md | 39 ++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/share/doc/homebrew/brew-tap.md b/share/doc/homebrew/brew-tap.md
index 63ab092793..0f36135d42 100644
--- a/share/doc/homebrew/brew-tap.md
+++ b/share/doc/homebrew/brew-tap.md
@@ -54,14 +54,39 @@ edavis/emacs
 
 ## Formula duplicate names
 
-If your tap contains a formula that is also present in master, that's fine, but
-it means that you must install it explicitly.
+If your tap contains a formula that is also present in master, that's fine,
+but it means that you must install it explicitly by default.
 
-For example, you can create a tap for an alternative `vim` formula, but in that
-case when you install from there you must run the command with a more explicit
-installation target:
+If you would like to prioritize a tap over master, you can use
+`brew tap-pin username/repo` to pin the tap,
+and use `brew tap-unpin username/repo` to revert the pin.
+
+Whenever a `brew install foo` command is issued, brew will find which formula
+to use by searching in the following order:
+
+* Pinned taps
+* Core formulas
+* Other taps
+
+If you need a formula to be installed from a particular tap, you can use fully
+qualified names to refer to them.
+
+For example, you can create a tap for an alternative `vim` formula. Without
+pinning it, the behavior will be
 
 ```bash
-brew install vim                 # installs from Homebrew/homebrew
-brew install username/repo/vim   # installs from your custom repo
+brew install vim                     # installs from Homebrew/homebrew
+brew install username/repo/vim       # installs from your custom repo
 ```
+
+However if you pin the tap with `brew tap-pin username/repo`, you will need to
+use `homebrew/homebrew` to refer to the core formula.
+
+```bash
+brew install vim                     # installs from your custom repo
+brew install homebrew/homebrew/vim   # installs from Homebrew/homebrew
+```
+
+Do note that pinned taps are prioritized only when the formula name is directly
+given by you. i.e., it will not influence formulae automatically installed as
+dependencies.
\ No newline at end of file
-- 
GitLab