From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Štěpán Němec" <stepnem@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Documentation: update-index: -z applies also to --index-info
Date: Fri, 8 Oct 2010 08:47:54 +0200 [thread overview]
Message-ID: <AANLkTimWOWHfLtiP8BkQ8ORMhjiyiAZm7Gn+OmQ2USfT@mail.gmail.com> (raw)
In-Reply-To: <7viq1dwg8v.fsf@alter.siamese.dyndns.org>
On Fri, Oct 8, 2010 at 04:49, Junio C Hamano <gitster@pobox.com> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
>> index 74d1d49..0999950 100644 Documentation/git-update-index.txt
>> --- a/Documentation/git-update-index.txt
>> +++ b/Documentation/git-update-index.txt
>> @@ -18,9 +18,9 @@ SYNOPSIS
>> [--skip-worktree | --no-skip-worktree]
>> [--ignore-submodules]
>> [--really-refresh] [--unresolve] [--again | -g]
>> - [--info-only] [--index-info]
>> - [-z] [--stdin]
>> + [--info-only]
>> [--verbose]
>> + [[-z] --stdin | --index-info]
>
> Hmm, this requires | to bind tighter than [] around -z, but that is a bit
> counterintuitive.
>
> Also, you can put -z much earlier, e.g. "update-index -z --add --stdin",
> and your version gives a false impression that we do not allow that.
>
> Writing it as "[-z] [--stdin | --index-info]" would be much easier to
> read, even though it won't convey that -z will be no-op unless we are
> reading from the standard input, either with --stdin or --index-info.
>
> I actually think we can easily lift the "must be at the end" limitation
> from both codepaths.
>
> Move the --stdin codepath to a separate helper like read_index_info(),
> remove the limitation, and add a new limitation that --stdin/--index-info
> can be given only once (as the reader will read thru EOF and the second
> call to the reader won't help us). And do the reading after processing
> all the command line stuff (i.e. move read_index_info() call after the
> option parsing loop), to allow "update-index --stdin --add hello.c" to add
> new paths read from standard input and also hello.c was given from the
> command line.
>
> Wouldn't it make much more sense to spend brain cycles to write and review
> such a patch, rather than documenting an unnecessary limitation?
>
> Hmm?
As the subject suspects, the main intention was to document that -z
applies also to --index-info. The reminder is only falloff while
fixing this inconsistency in the documentation.
So, yes we should have spend more time to remove this limitation that
they need to be the last option.
I will prepare a patch which handles only the -z/--index-info
documentation issue.
Bert
next prev parent reply other threads:[~2010-10-08 6:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 13:23 [PATCH] Documentation: update-index: -z applies also to --index-info Bert Wesarg
2010-10-07 18:33 ` Štěpán Němec
2010-10-07 18:52 ` Bert Wesarg
2010-10-07 18:55 ` Bert Wesarg
2010-10-07 19:15 ` Jonathan Nieder
2010-10-07 19:27 ` Štěpán Němec
2010-10-07 18:59 ` Bert Wesarg
2010-10-07 19:36 ` Štěpán Němec
2010-10-07 19:39 ` Bert Wesarg
2010-10-07 19:39 ` Bert Wesarg
2010-10-08 2:49 ` Junio C Hamano
2010-10-08 6:47 ` Bert Wesarg [this message]
2010-10-08 6:50 ` Bert Wesarg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTimWOWHfLtiP8BkQ8ORMhjiyiAZm7Gn+OmQ2USfT@mail.gmail.com \
--to=bert.wesarg@googlemail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=stepnem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).