Re: [PATCH v3 08/16] pathspec: always show mnemonic and name in unsupported_magic

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

 



On 01/03, Duy Nguyen wrote:
> On Wed, Dec 14, 2016 at 6:14 AM, Brandon Williams <bmwill@xxxxxxxxxx> wrote:
> > @@ -340,8 +336,9 @@ static void NORETURN unsupported_magic(const char *pattern,
> >                         continue;
> >                 if (sb.len)
> >                         strbuf_addch(&sb, ' ');
> > -               if (short_magic & m->bit)
> > -                       strbuf_addf(&sb, "'%c'", m->mnemonic);
> > +
> > +               if (m->mnemonic)
> > +                       strbuf_addf(&sb, "'(%c)%s'", m->mnemonic, m->name);
> >                 else
> >                         strbuf_addf(&sb, "'%s'", m->name);
> >         }
> 
> The die() call is out of diff context, but it'll print
> 
> pathspec magic not supported by this command: (!)top
> 
> which looks too much like :(<name>)<mnemonic> pathspec syntax too me
> and threw me off a bit. And it's a bit cryptic, isn't it? Since this
> is meant for human, maybe we can just write
> 
> pathspec magic not supported by this command: top (mnemonic: '!')

I was trying to keep it short and sweet, turns out that ends up being
more difficult to understand.  I like your suggestion, it definitely
makes things much clearer.

-- 
Brandon Williams



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