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

Re: [RFC PATCH 0/3] fast-import: add option command

From
Shawn O. Pearce <spearce@spearce.org>
Date
Aug 3, 2009, 00:15 UTC
Message-ID
<20090803001522.GE1033@spearce.org>
In-Reply-To
<1249189570-26576-1-git-send-email-srabbelier@gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 5 quoted lines
>     This allows the frontend to specify any of the supported options as
>     long as no non-option command has been given. This way the
>     user does not have to include any frontend-specific options, but
>     instead she can rely on the frontend to tell fast-import what it
>     needs.
...
>  fast-import.c          |  137 ++++++++++++++++++++++++++++++++++++-----------
>  t/t9300-fast-import.sh |   33 ++++++++++++
>  2 files changed, 138 insertions(+), 32 deletions(-)
Some comments:

Since you are changing the language format, please also update the documentation of the language.

It might be cleaner to say "option foo=value\n" because then the if block to parse the command line and the if block to parse the input stream are the same. When parsing argv just skip the "--" and pass the rest of the argv value into the function, when parsing the stream, just skip the "option " and pass the rest of the line into the function.

This has come up before on the list. We had somewhat decided against setting options in the stream header. The only option class that really impacts the data itself is the date format, all others are about local file paths or how noisy the command should be. Thus we decided that the frontend should invoke `git fast-import` itself if it cared about these options, and that's what any typical frontend does.

-- 
Shawn.
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 7 of 8 in “option directive to fast-import”
  1. Sverre RabbelierAug 2, 2009
  2. 0/3 fast-import: add option commandSverre Rabbelier, Aug 2, 2009
  3. 1/2 fast-import: put option parsing code in seperate functionsSverre Rabbelier, Aug 2, 2009
  4. 2/2 fast-import: add option commandSverre Rabbelier, Aug 2, 2009
  5. 3/3 fast-import: test the new option commandSverre Rabbelier, Aug 2, 2009
  6. 1/3 fast-import: put option parsing code in seperate functionsSverre Rabbelier, Aug 2, 2009
  7. Shawn O. PearceAug 3, 2009
  8. Sverre RabbelierAug 3, 2009

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.