Re: [PATCH v2 1/2] name-rev: deprecate --stdin in favor of --annotate-text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"John Cai via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: John Cai <johncai86@xxxxxxxxx>
>
> Introduce a --annotate-text that is functionally equivalent of --stdin.
> --stdin does not behave as --stdin in other subcommands, such as
> pack-objects whereby it takes one argument per line. Since --stdin can
> be a confusing and misleading name, rename it to --annotate-text.
>
> This change adds a warning to --stdin warning that it will be removed in
> the future.

The above (including the title) uses --annotate-TEXT; the
documentation and the code seems to use --annotate-STDIN.

>
> Signed-off-by: "John Cai" <johncai86@xxxxxxxxx>
> ---
>  Documentation/git-name-rev.txt | 29 ++++++++++++++++++++++++++++-
>  builtin/name-rev.c             | 19 ++++++++++++++-----
>  2 files changed, 42 insertions(+), 6 deletions(-)

We probably would want to fix existing tests that use --stdin for
its originally intended purpose to use its new spelling instead, and
a single new test to ensure that use of --stdin gives a warning as
expected.

> @@ -613,8 +622,8 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
>  	for_each_ref(name_ref, &data);
>  	name_tips();
>  
> -	if (transform_stdin) {
> -		char buffer[2048];
> +	if (annotate_stdin) {
> +		struct strbuf sb = STRBUF_INIT;
>  
>  		while (!feof(stdin)) {
>  			char *p = fgets(buffer, sizeof(buffer), stdin);

This block probably would not compile well.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux