Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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 at 11:14

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.