Re: [PATCH v2 6/7] gc: don't run "reflog expire" when keeping reflogs
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 15, 2019, 10:32 UTC
- Message-ID
- <CACsJy8DqABFXAVLObkRZCVCu_uozOVwp1P5bQeU5PCiV8cimwA@mail.gmail.com>
- In-Reply-To
- <877ed0bfl9.fsf@evledraar.gmail.com>
On Fri, Mar 15, 2019 at 5:24 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 23 quoted lines
>
>
> On Fri, Mar 15 2019, Duy Nguyen wrote:
>
> > On Thu, Mar 14, 2019 at 7:35 PM Ævar Arnfjörð Bjarmason
> > <avarab@gmail.com> wrote:
> >> @@ -127,6 +140,10 @@ static void gc_config(void)
> >> pack_refs = git_config_bool("gc.packrefs", value);
> >> }
> >>
> >> + if (gc_config_is_timestamp_never("gc.reflogexpire") &&
> >> + gc_config_is_timestamp_never("gc.reflogexpireunreachable"))
> >
> > Nit. configset api normalizes the key internally, so we can safely
> > write gc.reflogExpireUnreachable here, which is a bit easier to read.
>
> I didn't know that, do we want to do that?
>
> I'd think that as a matter of coding style always sticking to lower case
> in the C code made more sense, because e.g. you might #define a config
> key, and then use it both in git_config_*() as well as via strcmp() in
> some callback. Mixing the two would lead to confusion and possible bugs
> as we'd refactor the former of those patterns to the latter.I did a quick git grep on "git_config_get_". The majority is still in lower case. And given that this feature is not documented anywhere (I had a quick look at config.h and api-config.txt and ended up checking the code before the previous mail) yeah it's probably just safer to go with lowercase. At least until the old callback style is gone.
-- Duy