Re: [PATCH v4 6/6] config: add '--show-scope' to print the scope of a config value

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

 



I think this was a mess-up on my end.  I had meant to rename it to
config_scope_name() (after talking with Bert) but it appears that I
had messed up, so I think my mistake wasn't to rename the function, but
to fail to rename it.  So I do apologize.

On Fri, Jan 24, 2020 at 3:22 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> "Matthew Rogers via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:
>
> > +const char *scope_to_string(enum config_scope scope)
> > +{
> > +     switch (scope) {
> > +     case CONFIG_SCOPE_SYSTEM:
> > +             return "system";
> > +     case CONFIG_SCOPE_GLOBAL:
> > +             return "global";
> > +     case CONFIG_SCOPE_LOCAL:
> > +             return "local";
> > +     case CONFIG_SCOPE_WORKTREE:
> > +             return "worktree";
> > +     case CONFIG_SCOPE_COMMAND:
> > +             return "command";
> > +     case CONFIG_SCOPE_SUBMODULE:
> > +             return "submodule";
> > +     default:
> > +             return "unknown";
> > +     }
> > +}
>
> In earlier round(s), this was called config_scope_name(), wasn't it?
>
> "scope_to_string()" is a much worse than "config_scope_name()" as a
> name of a global function (e.g. we won't know what subsystems other
> than "config" may want to use "scope").  As you remember, Bert's
> "remote rename" series wants to use a public interface like this
> function, and the series expects this function to be called
> config_scope_name().  Let's not rename a public API function
> suddenly---it disrupts other topics in flight.
>
> Thanks.



-- 
Matthew Rogers



[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