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

Re: [PATCH 3/3] git --help COMMAND brings up the git-COMMAND man-page., take two

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Nov 16, 2005, 03:45 UTC
Message-ID
<437AAB48.7090904@zytor.com>
In-Reply-To
<20051116002318.A46C55BF97@nox.op5.se>
Andreas Ericsson wrote:
Show 19 quoted lines
>  
> +static void show_man_page(char *git_cmd)
> +{
> +	char *page;
> +
> +	if (!strncmp(git_cmd, "git", 3))
> +		page = git_cmd;
> +	else {
> +		int page_len = strlen(git_cmd) + 4;
> +
> +		page = malloc(page_len + 1);
> +		strcpy(page, "git-");
> +		strcpy(page + 4, git_cmd);
> +		page[page_len] = 0;
> +	}
> +
> +	execlp("man", "man", page, NULL);
> +}
> +

The way this made it into the actual tree was to call /usr/bin/man, but still using execlp(). This is clearly bogus. There *ARE* good reasons to use PATH resolutions for this, since man is one of the interactive commands the user may want to wrapper.

So please drop PATH_TO_MAN that made it into the repository and revert to the original patch.

	-hpa
Previous: Andreas EricssonNext: Andreas Ericsson
Message 2 of 9 in “git --help COMMAND brings up the git-COMMAND man-page., take two”
  1. 3/3 git --help COMMAND brings up the git-COMMAND man-page., take twoAndreas Ericsson, Nov 16, 2005
  2. H. Peter AnvinNov 16, 2005
  3. Andreas EricssonNov 16, 2005
  4. git wrapper: basic fixes.Junio C Hamano, Nov 16, 2005
  5. Johannes SchindelinNov 16, 2005
  6. Junio C HamanoNov 16, 2005
  7. H. Peter AnvinNov 16, 2005
  8. Andreas EricssonNov 16, 2005
  9. H. Peter AnvinNov 16, 2005

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.