Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Today, I accidentally typed man git diff which should give no results, as it should, according to the manual, be interpreted as page diff in section git. However, page git-diff(1) is actually shown. How can that be? (Using man 2.5.7 as included in Ubuntu Lucid)

share|improve this question
up vote 6 down vote accepted

man(1) on Ubuntu says:

--no-subpages
              By default, man will try to interpret pairs of manual page names given on the command line as
              equivalent to a single manual page name containing a hyphen.  This supports the  common  pat-
              tern  of  programs  that  implement  a number of subcommands, allowing them to provide manual
              pages for each that can be accessed using similar syntax as would be used to invoke the  sub-
              commands themselves.  For example:

                $ man -aw git diff
                /usr/share/man/man1/git-diff.1.gz

              To disable this behaviour, use the --no-subpages option.

                $ man -aw --no-subpages git diff
                /usr/share/man/man1/git.1.gz
                /usr/share/man/man3/Git.3pm.gz
                /usr/share/man/man1/diff.1.gz
share|improve this answer
    
That's funny -- they choosed the same example. Thanks! – artistoex May 22 '10 at 11:38
    
The man-db implementation of man added this in 2009 apparently: git.savannah.gnu.org/cgit/man-db.git/commit/… – David Röthlisberger Nov 26 '14 at 11:14

Git may have a reference for diff in git that points to git-diff.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .