Re: [PATCH v2 06/45] Add parse_pathspec() that converts cmdline args to struct pathspec

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

 



On Wed, Mar 20, 2013 at 8:16 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> +static void NORETURN unsupported_magic(const char *pattern,
> +                                      unsigned magic,
> +                                      unsigned short_magic)
> +{
> +       struct strbuf sb = STRBUF_INIT;
> +       int i, n;
> +       for (n = i = 0; i < ARRAY_SIZE(pathspec_magic); i++) {
> +               const struct pathspec_magic *m = pathspec_magic + i;
> +               if (!(magic & m->bit))
> +                       continue;
> +               if (sb.len)
> +                       strbuf_addstr(&sb, " ");
> +               if (short_magic & m->bit)
> +                       strbuf_addf(&sb, "'%c'", m->mnemonic);
> +               else
> +                       strbuf_addf(&sb, "'%s'", m->name);
> +               n++;
> +       }
> +       /*
> +        * We may want to substitue "this command" with a command

s/substitue/substitute/

> +        * name. E.g. when add--interactive dies when running
> +        * "checkout -p"
> +        */
> +       die(_("%s: pathspec magic not supported by this command: %s"),
> +           pattern, sb.buf);
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]