Re: [PATCH v5] attr: teach "--attr-source=<tree>" global option to "git"

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

 



On Wed, May 3, 2023 at 10:09 PM John Cai via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:

> @@ -314,6 +315,21 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
>                         } else {
>                                 exit(list_cmds(cmd));
>                         }
> +               } else if (!strcmp(cmd, "--attr-source")) {
> +                       if (*argc < 2) {
> +                               fprintf(stderr, _("no attribute source given for --attr-source\n" ));
> +                               usage(git_usage_string);
> +                       }
> +                       setenv(GIT_ATTR_SOURCE_ENVIRONMENT, (*argv)[1], 1);
> +                       if (envchanged)
> +                               *envchanged = 1;
> +                       (*argv)++;
> +                       (*argc)--;
> +               } else if (skip_prefix(cmd, "--attr-source=", &cmd)) {
> +                       set_git_attr_source(cmd);
> +                       setenv(GIT_ATTR_SOURCE_ENVIRONMENT, (*argv)[1], 1);

It seems to me that for other options "cmd" is used here instead of
"(*argv)[1]" as the second argument to setenv(), for example:

setenv(GIT_SUPER_PREFIX_ENVIRONMENT, cmd, 1);

> +                       if (envchanged)
> +                               *envchanged = 1;
>                 } else {
>                         fprintf(stderr, _("unknown option: %s\n"), cmd);
>                         usage(git_usage_string);




[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