# Bug: wrong documentation for git-fast-import's option command

3 messages from 2017-04-30 to 2017-05-01. Participants: Tomi Belan, Andreas Schwab.
Thread: https://gitlist.dev/t/45833

## Tomi Belan, 2017-04-30 00:07

Subject: Bug: wrong documentation for git-fast-import's option command
Message-ID: <CACUV5oeKoVdncK3RjtusiqrACj1xLiS--z8vC+Rsvy5TF09Lsw@mail.gmail.com>
URL: https://gitlist.dev/e/CACUV5oeKoVdncK3RjtusiqrACj1xLiS--z8vC%2BRsvy5TF09Lsw%40mail.gmail.com

```
The man page of git-fast-import says the syntax is "'option' SP
<option> LF". But this is wrong, and commands like that will be
silently ignored.

fast-import.c only parses commands starting with "option git ", and
ignores others starting with "option ". See
https://github.com/git/git/blob/027a3b943b444a3e3a76f9a89803fc10245b858f/fast-import.c#L3487-L3490
.

The correct syntax is e.g. "option git stats" or "option git
big-file-threshold=123". The docs should say "'option' SP 'git' SP
<option> LF" or maybe even "'option' SP 'git' SP <option> ('='
<argument>)? LF" (similarly to the docs for feature), and explain this
is meant to allow other consumers of the fast import format.

Looks like this bug existed since the option command was added in
9c8398f in 2009. Am I the first one who tried to use it? ;-)

Cheers,

Tomi

```

## Andreas Schwab, 2017-04-30 10:21

Subject: Re: Bug: wrong documentation for git-fast-import's option command
Message-ID: <874lx68abt.fsf@linux-m68k.org>
URL: https://gitlist.dev/e/874lx68abt.fsf%40linux-m68k.org
In-Reply-To: <CACUV5oeKoVdncK3RjtusiqrACj1xLiS--z8vC+Rsvy5TF09Lsw@mail.gmail.com>

```
On Apr 30 2017, Tomi Belan <tomi.belan@gmail.com> wrote:

> The man page of git-fast-import says the syntax is "'option' SP
> <option> LF". But this is wrong, and commands like that will be
> silently ignored.

Unless <option> starts with 'git', as you have seen.  Other importers
may recognize other options, eg 'option hg ...'.

> The correct syntax is e.g. "option git stats" or "option git
> big-file-threshold=123". The docs should say "'option' SP 'git' SP
> <option> LF" or maybe even "'option' SP 'git' SP <option> ('='
> <argument>)? LF" (similarly to the docs for feature), and explain this
> is meant to allow other consumers of the fast import format.
>
> Looks like this bug existed since the option command was added in
> 9c8398f in 2009. Am I the first one who tried to use it? ;-)
>
> Cheers,
>
> Tomi
>

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```

## Tomi Belan, 2017-05-01 13:26

Subject: Re: Bug: wrong documentation for git-fast-import's option command
Message-ID: <CACUV5ocdADaXYpcQG6kJ0CaR+d+EwyaSFFReaO2ni+1CnJMvyw@mail.gmail.com>
URL: https://gitlist.dev/e/CACUV5ocdADaXYpcQG6kJ0CaR%2Bd%2BEwyaSFFReaO2ni%2B1CnJMvyw%40mail.gmail.com
In-Reply-To: <874lx68abt.fsf@linux-m68k.org>

```
On Sun, Apr 30, 2017 at 12:21 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Unless <option> starts with 'git', as you have seen.  Other importers
> may recognize other options, eg 'option hg ...'.

Hmm? Are you disagreeing with how I described the issue, or saying
there is no issue at all? I'm not sure.

I know the syntax is meant for other importers, which might accept
different options. My point is that the man page doesn't say anything
about that. If a frontend follows the man page and just prints e.g.
"option quiet", git-fast-import will silently ignore it.

If you dislike my suggested fix "'option' SP 'git' SP ...", then how about
'option' SP <program> SP <option> ('=' <argument>)? LF
and saying that for options supported by Git, <program> must be 'git'?

Cheers,

Tomi

```
