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

Re: [PATCH 9/10] Remove cmd_usage() routine and re-organize the help/usage code.

From
Junio C Hamano <junkio@cox.net>
Date
Aug 4, 2006, 04:33 UTC
Message-ID
<7vslkdnmra.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<000101c6b72a$51601a80$c47eedc1@ramsay1.demon.co.uk>
"Ramsay Jones" <ramsay@ramsay1.demon.co.uk> writes:
> Speaking of consistency, I noticed some inconsistent command
> names in various usage strings. I attach a patch (p0011.txt)
> for your consideration.
Thanks, all look good.
Show 11 quoted lines
> During one of my "grep-fests", I also noticed some calls to
> die(usage_string) rather than usage(usage_string). Calling die()
> rather than usage() means that a "fatal: " (rather than "usage: ")
> prefix is output prior the usage string, and the exit code
> is 128 (rather than 129).
>
> It looks like to choice of die() was deliberate, particularly in
> builtin-rm.c and hash-object.c since they call both die() and
> usage(). However, It's not clear to me why this choice was made.
> (Which is not to say there isn't a perfectly good reason for the
> choice; it's just that I don't see it.)

I think these were all sloppy coding. The fix you did with p0012 look good -- all of them are complaining that the command line parsing found something unexpected, so I think usage() is more appropriate.

Previous: Junio C HamanoNext: Ramsay Jones
Message 6 of 7 in “Remove cmd_usage() routine and re-organize the help/usage code.”
  1. 9/10 Remove cmd_usage() routine and re-organize the help/usage code.Ramsay Jones, Aug 2, 2006
  2. Martin WaitzAug 2, 2006
  3. Junio C HamanoAug 2, 2006
  4. Ramsay JonesAug 3, 2006
  5. Junio C HamanoAug 3, 2006
  6. Junio C HamanoAug 4, 2006
  7. Ramsay JonesAug 2, 2006

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.