From: Sverre Rabbelier Date: Wed, 02 Sep 2009 17:57:02 GMT Subject: [PATCH v6 5/6] fast-import: add option command Message-ID: <1251914223-31435-6-git-send-email-srabbelier@gmail.com> In-Reply-To: <1251914223-31435-5-git-send-email-srabbelier@gmail.com> 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. Also factor out parsing of argv and have it execute when we reach the first non-option command, or after all commands have been read and no non-option command has been encountered. Signed-off-by: Sverre Rabbelier --- Main difference with v5 is that the syntax is now 'option git ...' as per a discussion with the other fast-import devs. Other options, e.g. 'option hg' are ignored. Also fixed the docs to say that feature commands are allowed before git option commands. Documentation/git-fast-import.txt | 24 ++++++++++++ fast-import.c | 75 +++++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 12 deletions(-) diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 1e293f2..f1c94b4 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -307,6 +307,11 @@ and control the current import process. More detailed discussion Require that fast-import supports the specified feature, or abort if it does not. +`option`:: + Specify any of the options listed under OPTIONS to change + fast-import's behavior to suit the frontend's needs. This command + is optional and is not needed to perform an import. + `commit` ~~~~~~~~ Create or update a branch with a new commit, recording one logical @@ -829,6 +834,25 @@ it does not. The part of the command may be any string matching [a-zA-Z-] and should be understood by a version of fast-import. +`option` +~~~~~~~~ +Processes the specified option so that git fast-import behaves in a +way that suits the frontend's needs. +Note that options specified by the frontend are overridden by any +options the user may specify to git fast-import itself. + +.... + 'option' SP