git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Documentation: update-index: -z applies also to --index-info
@ 2010-10-07 13:23 Bert Wesarg
  2010-10-07 18:33 ` Štěpán Němec
  0 siblings, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 13:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Štěpán Němec, Bert Wesarg

Also mention, that --stdin and --index-info needs to be the last
option supplied and indicate this in the usage string.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---

We may like the usage string like this:

[[-z] --stdin | --index-info]

to make it also clear, that -z applies only to --stdin or --index-only.
---
 Documentation/git-update-index.txt |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 74d1d49..4441d7c 100644 Documentation/git-update-index.txt
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -18,8 +18,9 @@ SYNOPSIS
 	     [--skip-worktree | --no-skip-worktree]
 	     [--ignore-submodules]
 	     [--really-refresh] [--unresolve] [--again | -g]
-	     [--info-only] [--index-info]
-	     [-z] [--stdin]
+	     [--info-only]
+	     [-z]
+	     [--stdin] [--index-info]
 	     [--verbose]
 	     [--] [<file>]*
 
@@ -72,7 +73,7 @@ OPTIONS
 	Directly insert the specified info into the index.
 
 --index-info::
-        Read index information from stdin.
+        Read index information from stdin (Must be last option).
 
 --chmod=(+|-)x::
         Set the execute permissions on the updated files.
@@ -138,14 +139,15 @@ you will need to handle the situation manually.
 --stdin::
 	Instead of taking list of paths from the command line,
 	read list of paths from the standard input.  Paths are
-	separated by LF (i.e. one path per line) by default.
+	separated by LF (i.e. one path per line) by default
+	(Must be last option).
 
 --verbose::
         Report what is being added and removed from index.
 
 -z::
-	Only meaningful with `--stdin`; paths are separated with
-	NUL character instead of LF.
+	Only meaningful with `--stdin` or `--index-info`; paths are
+	separated with NUL character instead of LF.
 
 \--::
 	Do not interpret any more arguments as options.
-- 
1.7.1.1067.g5aeb7

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Štěpán Němec @ 2010-10-07 18:33 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Junio C Hamano, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

> Also mention, that --stdin and --index-info needs to be the last
> option supplied and indicate this in the usage string.
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> ---
>
> We may like the usage string like this:
>
> [[-z] --stdin | --index-info]

Yeah, that'd be definitely better IMO.

Also the usage string in builtin/update-index.c should be updated to the
same effect.

There is actually at least one more problem with the current SYNOPSIS of
`update-index'. Obviously the `*' on the third line of the Asciidoc
source makes the whole `--cacheinfo' line disappear and the rest bold
(cf. e.g. the result at
<http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html>).

I guess using `...' instead of the asterisks (also on the last line,
i.e. [<file>...], not [<file>]*) would both fix the problem and at the
same time make it more consistent with other man pages.

> to make it also clear, that -z applies only to --stdin or --index-only.
> ---
>  Documentation/git-update-index.txt |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/git-update-index.txt
> b/Documentation/git-update-index.txt
> index 74d1d49..4441d7c 100644 Documentation/git-update-index.txt
> --- a/Documentation/git-update-index.txt
> +++ b/Documentation/git-update-index.txt
> @@ -18,8 +18,9 @@ SYNOPSIS
>  	     [--skip-worktree | --no-skip-worktree]
>  	     [--ignore-submodules]
>  	     [--really-refresh] [--unresolve] [--again | -g]
> -	     [--info-only] [--index-info]
> -	     [-z] [--stdin]
> +	     [--info-only]
> +	     [-z]
> +	     [--stdin] [--index-info]
>  	     [--verbose]
>  	     [--] [<file>]*

Shouldn't `--verbose' be also moved before the must-be-last options?

> @@ -72,7 +73,7 @@ OPTIONS
>  	Directly insert the specified info into the index.
>  
>  --index-info::
> -        Read index information from stdin.
> +        Read index information from stdin (Must be last option).

I'm not a native speaker myself, but I suspect "must be THE last option"
is more correct (including the lower-case `m' :-)).

>  --chmod=(+|-)x::
>          Set the execute permissions on the updated files.
> @@ -138,14 +139,15 @@ you will need to handle the situation manually.
>  --stdin::
>  	Instead of taking list of paths from the command line,
>  	read list of paths from the standard input.  Paths are
> -	separated by LF (i.e. one path per line) by default.
> +	separated by LF (i.e. one path per line) by default
> +	(Must be last option).

(same here)

>  
>  --verbose::
>          Report what is being added and removed from index.
>  
>  -z::
> -	Only meaningful with `--stdin`; paths are separated with
> -	NUL character instead of LF.
> +	Only meaningful with `--stdin` or `--index-info`; paths are
> +	separated with NUL character instead of LF.
>  
>  \--::
>  	Do not interpret any more arguments as options.

Thanks,

Štěpán

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  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 18:59     ` Bert Wesarg
  0 siblings, 2 replies; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 18:52 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Junio C Hamano, git

On Thu, Oct 7, 2010 at 20:33, Štěpán Němec <stepnem@gmail.com> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> Also mention, that --stdin and --index-info needs to be the last
>> option supplied and indicate this in the usage string.
>>
>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>
>> ---
>>
>> We may like the usage string like this:
>>
>> [[-z] --stdin | --index-info]
>
> Yeah, that'd be definitely better IMO.

Will do.

>
> Also the usage string in builtin/update-index.c should be updated to the
> same effect.
>
> There is actually at least one more problem with the current SYNOPSIS of
> `update-index'. Obviously the `*' on the third line of the Asciidoc
> source makes the whole `--cacheinfo' line disappear and the rest bold
> (cf. e.g. the result at
> <http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html>).
>
> I guess using `...' instead of the asterisks (also on the last line,
> i.e. [<file>...], not [<file>]*) would both fix the problem and at the
> same time make it more consistent with other man pages.

I wont change it in this patch, because I can't build the html docs right now.

>
>> to make it also clear, that -z applies only to --stdin or --index-only.
>> ---
>>  Documentation/git-update-index.txt |   14 ++++++++------
>>  1 files changed, 8 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/git-update-index.txt
>> b/Documentation/git-update-index.txt
>> index 74d1d49..4441d7c 100644 Documentation/git-update-index.txt
>> --- a/Documentation/git-update-index.txt
>> +++ b/Documentation/git-update-index.txt
>> @@ -18,8 +18,9 @@ SYNOPSIS
>>            [--skip-worktree | --no-skip-worktree]
>>            [--ignore-submodules]
>>            [--really-refresh] [--unresolve] [--again | -g]
>> -          [--info-only] [--index-info]
>> -          [-z] [--stdin]
>> +          [--info-only]
>> +          [-z]
>> +          [--stdin] [--index-info]
>>            [--verbose]
>>            [--] [<file>]*
>
> Shouldn't `--verbose' be also moved before the must-be-last options?

Sure. I noticed this myself, but the patch was already in the wire.

>
>> @@ -72,7 +73,7 @@ OPTIONS
>>       Directly insert the specified info into the index.
>>
>>  --index-info::
>> -        Read index information from stdin.
>> +        Read index information from stdin (Must be last option).
>
> I'm not a native speaker myself, but I suspect "must be THE last option"
> is more correct (including the lower-case `m' :-)).

Maybe this should be in its own sentence, like the '(Implies
--remove.)' in --force-remove.

>
>>  --chmod=(+|-)x::
>>          Set the execute permissions on the updated files.
>> @@ -138,14 +139,15 @@ you will need to handle the situation manually.
>>  --stdin::
>>       Instead of taking list of paths from the command line,
>>       read list of paths from the standard input.  Paths are
>> -     separated by LF (i.e. one path per line) by default.
>> +     separated by LF (i.e. one path per line) by default
>> +     (Must be last option).
>
> (same here)
>
>>
>>  --verbose::
>>          Report what is being added and removed from index.
>>
>>  -z::
>> -     Only meaningful with `--stdin`; paths are separated with
>> -     NUL character instead of LF.
>> +     Only meaningful with `--stdin` or `--index-info`; paths are
>> +     separated with NUL character instead of LF.
>>
>>  \--::
>>       Do not interpret any more arguments as options.
>
> Thanks,

Thank you.

Bert

>
> Štěpán
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 18:52   ` Bert Wesarg
@ 2010-10-07 18:55     ` Bert Wesarg
  2010-10-07 19:15       ` Jonathan Nieder
  2010-10-07 18:59     ` Bert Wesarg
  1 sibling, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 18:55 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Junio C Hamano, git

On Thu, Oct 7, 2010 at 20:52, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> On Thu, Oct 7, 2010 at 20:33, Štěpán Němec <stepnem@gmail.com> wrote:
>>
>> Also the usage string in builtin/update-index.c should be updated to the
>> same effect.
>>
>> There is actually at least one more problem with the current SYNOPSIS of
>> `update-index'. Obviously the `*' on the third line of the Asciidoc
>> source makes the whole `--cacheinfo' line disappear and the rest bold
>> (cf. e.g. the result at
>> <http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html>).

ls-files too:
http://www.kernel.org/pub/software/scm/git/docs/git-ls-files.html

So it deserve more attention and its own patch.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 18:52   ` Bert Wesarg
  2010-10-07 18:55     ` Bert Wesarg
@ 2010-10-07 18:59     ` Bert Wesarg
  2010-10-07 19:36       ` Štěpán Němec
  1 sibling, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 18:59 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Junio C Hamano, git, Bert Wesarg

Also mention, that --stdin and --index-info needs to be the last
option supplied and indicate this in the usage string.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 Documentation/git-update-index.txt |   13 +++++++------
 builtin/update-index.c             |    2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 74d1d49..022c0fc 100644 Documentation/git-update-index.txt
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -18,10 +18,10 @@ SYNOPSIS
 	     [--skip-worktree | --no-skip-worktree]
 	     [--ignore-submodules]
 	     [--really-refresh] [--unresolve] [--again | -g]
-	     [--info-only] [--index-info]
-	     [-z] [--stdin]
+	     [--info-only]
 	     [--verbose]
-	     [--] [<file>]*
+	     [[-z] --stdin | --index-info]
+	     [--] [<file>]
 
 DESCRIPTION
 -----------
@@ -72,7 +72,7 @@ OPTIONS
 	Directly insert the specified info into the index.
 
 --index-info::
-        Read index information from stdin.
+        Read index information from stdin. (Must be the last option.)
 
 --chmod=(+|-)x::
         Set the execute permissions on the updated files.
@@ -139,13 +139,14 @@ you will need to handle the situation manually.
 	Instead of taking list of paths from the command line,
 	read list of paths from the standard input.  Paths are
 	separated by LF (i.e. one path per line) by default.
+	(Must be the last option.)
 
 --verbose::
         Report what is being added and removed from index.
 
 -z::
-	Only meaningful with `--stdin`; paths are separated with
-	NUL character instead of LF.
+	Only meaningful with `--stdin` or `--index-info`; paths are
+	separated with NUL character instead of LF.
 
 \--::
 	Do not interpret any more arguments as options.
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 3ab214d..2c1a81e 100644 builtin/update-index.c
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -398,7 +398,7 @@ static void read_index_info(int line_termination)
 }
 
 static const char update_index_usage[] =
-"git update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--skip-worktree|--no-skip-worktree] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--again | -g] [--ignore-missing] [-z] [--verbose] [--] <file>...";
+"git update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--skip-worktree|--no-skip-worktree] [--info-only] [--force-remove] [--unresolve] [--again | -g] [--ignore-missing] [--verbose] [[-z] --stdin | --index-info] [--] <file>...";
 
 static unsigned char head_sha1[20];
 static unsigned char merge_head_sha1[20];
-- 
1.7.1.1067.g5aeb7

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 18:55     ` Bert Wesarg
@ 2010-10-07 19:15       ` Jonathan Nieder
  2010-10-07 19:27         ` Štěpán Němec
  0 siblings, 1 reply; 13+ messages in thread
From: Jonathan Nieder @ 2010-10-07 19:15 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Štěpán Němec, Junio C Hamano, git

Bert Wesarg wrote:
> On Thu, Oct 7, 2010 at 20:52, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> On Thu, Oct 7, 2010 at 20:33, Štěpán Němec <stepnem@gmail.com> wrote:

>>> There is actually at least one more problem with the current SYNOPSIS of
>>> `update-index'. Obviously the `*' on the third line of the Asciidoc
>>> source makes the whole `--cacheinfo' line disappear and the rest bold
>>> (cf. e.g. the result at
>>> <http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html>).
>
> ls-files too:
> http://www.kernel.org/pub/software/scm/git/docs/git-ls-files.html

Hmph, this is from v1.7.3-rc0~15^2~9 (Documentation: remove backslashes
in manpage synopses, 2010-08-20).  And it still works for me locally
(for both manpage and HTML generation). :(

Anyway, the "..." fix sounds good to me (or {asterisk} if the stars are
still wanted).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 19:15       ` Jonathan Nieder
@ 2010-10-07 19:27         ` Štěpán Němec
  0 siblings, 0 replies; 13+ messages in thread
From: Štěpán Němec @ 2010-10-07 19:27 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Bert Wesarg, Junio C Hamano, git

Jonathan Nieder <jrnieder@gmail.com> writes:

> Bert Wesarg wrote:
>> On Thu, Oct 7, 2010 at 20:52, Bert Wesarg <bert.wesarg@googlemail.com>
> wrote:
>>> On Thu, Oct 7, 2010 at 20:33, Štěpán Němec <stepnem@gmail.com> wrote:
>
>>>> There is actually at least one more problem with the current SYNOPSIS of
>>>> `update-index'. Obviously the `*' on the third line of the Asciidoc
>>>> source makes the whole `--cacheinfo' line disappear and the rest bold
>>>> (cf. e.g. the result at
>>>> <http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html>).
>>
>> ls-files too:
>> http://www.kernel.org/pub/software/scm/git/docs/git-ls-files.html
>
> Hmph, this is from v1.7.3-rc0~15^2~9 (Documentation: remove backslashes
> in manpage synopses, 2010-08-20).  And it still works for me locally
> (for both manpage and HTML generation). :(
>
> Anyway, the "..." fix sounds good to me (or {asterisk} if the stars are
> still wanted).

Yeah, there are some more actually. I'll send in a separate patch shortly.

Štěpán

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 18:59     ` Bert Wesarg
@ 2010-10-07 19:36       ` Štěpán Němec
  2010-10-07 19:39         ` Bert Wesarg
  0 siblings, 1 reply; 13+ messages in thread
From: Štěpán Němec @ 2010-10-07 19:36 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Junio C Hamano, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

> Also mention, that --stdin and --index-info needs to be the last
> option supplied and indicate this in the usage string.
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> ---
>  Documentation/git-update-index.txt |   13 +++++++------
>  builtin/update-index.c             |    2 +-
>  2 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/git-update-index.txt
> b/Documentation/git-update-index.txt
> index 74d1d49..022c0fc 100644 Documentation/git-update-index.txt
> --- a/Documentation/git-update-index.txt
> +++ b/Documentation/git-update-index.txt
> @@ -18,10 +18,10 @@ SYNOPSIS
>  	     [--skip-worktree | --no-skip-worktree]
>  	     [--ignore-submodules]
>  	     [--really-refresh] [--unresolve] [--again | -g]
> -	     [--info-only] [--index-info]
> -	     [-z] [--stdin]
> +	     [--info-only]
>  	     [--verbose]
> -	     [--] [<file>]*
> +	     [[-z] --stdin | --index-info]
> +	     [--] [<file>]

If you want to remove the asterisk after all, then please make it
`<file>...', not `[<file>]'.

Štěpán

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 19:36       ` Štěpán Němec
@ 2010-10-07 19:39         ` Bert Wesarg
  2010-10-07 19:39           ` Bert Wesarg
  0 siblings, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 19:39 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Junio C Hamano, git

On Thu, Oct 7, 2010 at 21:36, Štěpán Němec <stepnem@gmail.com> wrote:
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
>> Also mention, that --stdin and --index-info needs to be the last
>> option supplied and indicate this in the usage string.
>>
>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>> ---
>>  Documentation/git-update-index.txt |   13 +++++++------
>>  builtin/update-index.c             |    2 +-
>>  2 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/Documentation/git-update-index.txt
>> b/Documentation/git-update-index.txt
>> index 74d1d49..022c0fc 100644 Documentation/git-update-index.txt
>> --- a/Documentation/git-update-index.txt
>> +++ b/Documentation/git-update-index.txt
>> @@ -18,10 +18,10 @@ SYNOPSIS
>>            [--skip-worktree | --no-skip-worktree]
>>            [--ignore-submodules]
>>            [--really-refresh] [--unresolve] [--again | -g]
>> -          [--info-only] [--index-info]
>> -          [-z] [--stdin]
>> +          [--info-only]
>>            [--verbose]
>> -          [--] [<file>]*
>> +          [[-z] --stdin | --index-info]
>> +          [--] [<file>]
>
> If you want to remove the asterisk after all, then please make it
> `<file>...', not `[<file>]'.

Sorry. That was only by accident. Updated patch will follow.

Bert

>
> Štěpán
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 19:39         ` Bert Wesarg
@ 2010-10-07 19:39           ` Bert Wesarg
  2010-10-08  2:49             ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-07 19:39 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: Junio C Hamano, git, Bert Wesarg

Also mention, that --stdin and --index-info needs to be the last
option supplied and indicate this in the usage string.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 Documentation/git-update-index.txt |   11 ++++++-----
 builtin/update-index.c             |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

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]
 	     [--] [<file>]*
 
 DESCRIPTION
@@ -72,7 +72,7 @@ OPTIONS
 	Directly insert the specified info into the index.
 
 --index-info::
-        Read index information from stdin.
+        Read index information from stdin. (Must be the last option.)
 
 --chmod=(+|-)x::
         Set the execute permissions on the updated files.
@@ -139,13 +139,14 @@ you will need to handle the situation manually.
 	Instead of taking list of paths from the command line,
 	read list of paths from the standard input.  Paths are
 	separated by LF (i.e. one path per line) by default.
+	(Must be the last option.)
 
 --verbose::
         Report what is being added and removed from index.
 
 -z::
-	Only meaningful with `--stdin`; paths are separated with
-	NUL character instead of LF.
+	Only meaningful with `--stdin` or `--index-info`; paths are
+	separated with NUL character instead of LF.
 
 \--::
 	Do not interpret any more arguments as options.
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 3ab214d..2c1a81e 100644 builtin/update-index.c
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -398,7 +398,7 @@ static void read_index_info(int line_termination)
 }
 
 static const char update_index_usage[] =
-"git update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--skip-worktree|--no-skip-worktree] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--again | -g] [--ignore-missing] [-z] [--verbose] [--] <file>...";
+"git update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--skip-worktree|--no-skip-worktree] [--info-only] [--force-remove] [--unresolve] [--again | -g] [--ignore-missing] [--verbose] [[-z] --stdin | --index-info] [--] <file>...";
 
 static unsigned char head_sha1[20];
 static unsigned char merge_head_sha1[20];
-- 
1.7.1.1067.g5aeb7

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-07 19:39           ` Bert Wesarg
@ 2010-10-08  2:49             ` Junio C Hamano
  2010-10-08  6:47               ` Bert Wesarg
  0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2010-10-08  2:49 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Štěpán Němec, git

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?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-08  2:49             ` Junio C Hamano
@ 2010-10-08  6:47               ` Bert Wesarg
  2010-10-08  6:50                 ` Bert Wesarg
  0 siblings, 1 reply; 13+ messages in thread
From: Bert Wesarg @ 2010-10-08  6:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Štěpán Němec, git

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] Documentation: update-index: -z applies also to --index-info
  2010-10-08  6:47               ` Bert Wesarg
@ 2010-10-08  6:50                 ` Bert Wesarg
  0 siblings, 0 replies; 13+ messages in thread
From: Bert Wesarg @ 2010-10-08  6:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Štěpán Němec, Bert Wesarg

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 Documentation/git-update-index.txt |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 74d1d49..26fd8d0 100644 Documentation/git-update-index.txt
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -144,8 +144,8 @@ you will need to handle the situation manually.
         Report what is being added and removed from index.
 
 -z::
-	Only meaningful with `--stdin`; paths are separated with
-	NUL character instead of LF.
+	Only meaningful with `--stdin` or `--index-info`; paths are
+	separated with NUL character instead of LF.
 
 \--::
 	Do not interpret any more arguments as options.
-- 
1.7.1.1067.g5aeb7

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-10-08  6:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2010-10-08  6:50                 ` Bert Wesarg

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).