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

Re: [PATCH] Allow 'git cmd -h' outside of repository

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 29, 2008, 11:44 UTC
Message-ID
<fcaeb9bf0808290444n579590a3ob01f7b4178e7a210@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0808291333010.24820@pacific.mpi-cbg.de.mpi-cbg.de>
On 8/29/08, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 22 quoted lines
> Hi,
>
>
>  On Thu, 28 Aug 2008, SZEDER Gábor wrote:
>
>  > Printing usage strings of git commands should obviously not depend on
>  > the command being run inside a git repository.  However, in case of a
>  > command requiring a repository, the command line options are parsed only
>  > after it is ensured that the command was started inside a repository,
>  > resulting in a 'fatal: Not a git repository' if 'git cmd -h' wasn't
>  > executed inside a repository.
>  >
>  > To get around this issue, we will check early for the presence of '-h'
>  > option, and skip ensuring that the command is run inside a repository.
>
>
> You miss the fact that "git grep -h" does not mean "show usage".  Oh, and
>  "git ls-remote -h" neither.  Three times's a charm: "git show-ref -h" does
>  not show the help either.
>
>  I am also not quite certain if we should not just tout "git help <cmd>" as
>  the official way to request help.

No we should not (at least to me), usage strings are shorter and don't require man. As for allowing "git cmd -h" outside repository, I think Jeff's idea of refactoring setup procedure, setting up if possible but not barfing, would solve it.

-- 
Duy
Previous: Johannes SchindelinNext: SZEDER Gábor
Message 3 of 4 in “Allow 'git cmd -h' outside of repository”
  1. Allow 'git cmd -h' outside of repositorySZEDER Gábor, Aug 28, 2008
  2. Johannes SchindelinAug 29, 2008
  3. Nguyen Thai Ngoc DuyAug 29, 2008
  4. SZEDER GáborAug 29, 2008

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.