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

Re: [PATCH] Make GIT-VERSION-GEN tolerate missing git describe command

From
JEJohn Ellson <ellson@research.att.com>
Date
Dec 30, 2005, 19:12 UTC
Message-ID
<43B586B4.5030001@research.att.com>
In-Reply-To
<Pine.LNX.4.64.0512301046230.3249@g5.osdl.org>
Linus Torvalds wrote:
Show 29 quoted lines
> On Fri, 30 Dec 2005, John Ellson wrote:
>   
>> I think it is probably a bug that "git non_existent_command"
>> returns its error message to stdout without an error, where
>> "git-non_existent_command" behaves differently and does return an
>> error.
>>
>> Older versions of git did not implement "git describe"  and
>> GIT-VERSION-GEN produces an empty version string if run on
>> a system with such a git installed.  The consequence
>> is that "make rpm" fails.
>>
>> This patch fixes GIT-VERSION-GEN so that it works in the
>> absence of a working "git describe"
>>     
>
> Shouldn't you make "git.c" return an error too, so that "git-describe" and 
> "git describe" both fail properly?
>
> I realize that you'd want to do your patch _too_ (in case somebody has an 
> old version of "git" installed), but I just think it would be sensible to 
> fix the problem that causes this in the first place..
>
> Continuing to output to stdout rather than stderr is probably a good idea 
> (so that it's easy to do "git help | less" or something), but yeah, I 
> think an unrecognized command should at least return an error.
>
> 		Linus
>   

I checked and that bug has been fixed since the older version of git that was causing me problems. "git non_existent_command" now returns 1. However, the error message was also changed to goto stderr, which it sounds like you disagree with? Personally I don't have a problem with it, although a real "git-help" command might be a good idea too.

John
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 6 in “Make GIT-VERSION-GEN tolerate missing git describe command”
  1. Make GIT-VERSION-GEN tolerate missing git describe commandJohn Ellson, Dec 30, 2005
  2. Linus TorvaldsDec 30, 2005
  3. John EllsonDec 30, 2005
  4. Linus TorvaldsDec 30, 2005
  5. John EllsonDec 30, 2005
  6. H. Peter AnvinDec 31, 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.