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

Re: Bring parse_options to the shell

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 2, 2007, 18:21 UTC
Message-ID
<Pine.LNX.4.64.0711021818480.4362@racer.site>
In-Reply-To
<20071102160925.GC27505@artemis.corp>
Hi,
On Fri, 2 Nov 2007, Pierre Habouzit wrote:
Show 17 quoted lines
> On Fri, Nov 02, 2007 at 03:51:13PM +0000, Linus Torvalds wrote:
> 
> > That command [rev-parse] was written exactly to parse a command line. 
> > This is really cheesy, and doesn't really work right (it splits up 
> > numbers too), but you get the idea..
> 
>   I get the idea, though parse-options is not incremental at all, this 
> could probably be done, but would complicate the API (we would need to 
> allocate a state object e.g.). And parseoptions checks that options 
> getting an argument have one, checks that options exists and so on. It 
> looks like to me that it's not easy to plumb into rev-parse without 
> being a brand new independant mode.
> 
>   We can do that, if we don't want yet-another-git-builtin/command, but 
> in the spirit it'll remain a brand new "thing".
> 
>   Though I'd be glad to hear about what others think about it.

Yeah, rev-parse's only purpose in life is to help scripts. (Even if it is used sometimes -- even by myself -- to turn symbolic names into SHA-1s.)

IMHO it makes tons of sense to put the functionality into that command, even if it is not incremental.

Ciao, Dscho

Previous: Pierre HabouzitNext: Pierre Habouzit
Message 7 of 8 in “Bring parse_options to the shell”
  1. Pierre HabouzitNov 2, 2007
  2. Add git-parseopt(1) to bring parse-options to shell scripts.Pierre Habouzit, Nov 2, 2007
  3. Update git-sh-setup(1) to allow transparent use of git-parseopt(1)Pierre Habouzit, Nov 2, 2007
  4. Pierre HabouzitNov 2, 2007
  5. Linus TorvaldsNov 2, 2007
  6. Pierre HabouzitNov 2, 2007
  7. Johannes SchindelinNov 2, 2007
  8. Pierre HabouzitNov 2, 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.