git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git help error

From
LRLuciano Rocha <luciano@eurotux.com>
Date
Dec 4, 2007, 20:06 UTC
Message-ID
<20071204200625.GA32717@bit.office.eurotux.com>
In-Reply-To
<863auiw86m.fsf@lola.quinscape.zz>
On Tue, Dec 04, 2007 at 08:50:41PM +0100, David Kastrup wrote:
Show 15 quoted lines
> Luciano Rocha <strange@nsk.no-ip.org> writes:
> 
> > On Tue, Dec 04, 2007 at 11:40:15AM -0800, Junio C Hamano wrote:
> >
> >> Having said that, I do not mind accepting a patch that prepends the
> >> nonlocal path to MANPATH in help.c::show_man_page().
> >
> > Actually, current man utilities locate the manual page by looking where
> > the executable is, if MANPATH isn't defined (tested in Linux and
> > Darwin).
> >
> > So, "unset MANPATH; man git-add" should be sufficient.
> 
> That only works for paths registered in /etc/manpath.config (or an
> equivalent config file depending on system/distribution).

Err, no. I doubt my ~/opt/noarch/.../...; ~/opt/`uname -i`/git/; etc., are pre-registered by my Linux distro or OS X 10.[45].

man man:
       If you specify the -M pathlist option, pathlist  is  a  colon-separated
       list of the directories that man searches.
       If  you  don’t specify -M but set the MANPATH environment variable, the
       value of that  variable  is  the  list  of  the  directories  that  man
       searches.
       If  you  don’t  specify  an  explicit path list with -M or MANPATH, man
       develops its own path list based on the contents of  the  configuration
       file /etc/man.config.  The MANPATH statements in the configuration file
       identify particular directories to include in the search path.
...
       In addition, for each directory in the command search path (we’ll  call
       it  a  "command  directory")  for  which  you do not have a MANPATH_MAP
       statement, man automatically looks for a manual page directory "nearby"
       namely as a subdirectory in the command directory itself or in the par-
       ent directory of the command directory.

So, according to the last paragraph, and assuming no -M argument and no MANPATH environment variable are defined, man should be able to find the manual pages for git commands if they're in PATH.

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
Previous: David KastrupNext: Sergei Organov
Message 7 of 8 in “git help error”
  1. Aneesh KumarDec 4, 2007
  2. Junio C HamanoDec 4, 2007
  3. Sergei OrganovDec 4, 2007
  4. Junio C HamanoDec 4, 2007
  5. Luciano RochaDec 4, 2007
  6. David KastrupDec 4, 2007
  7. Luciano RochaDec 4, 2007
  8. Sergei OrganovDec 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.