Re: [PATCH v2 13/24] builtin/init-db: allow specifying hash algorithm on command line
On 2020-02-24 at 18:14:33, Junio C Hamano wrote:
Show 7 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
> > 'git init' [-q | --quiet] [--bare] [--template=<template_directory>]
> > - [--separate-git-dir <git dir>]
> > + [--separate-git-dir <git dir>] [--object-format=<format]
>
> A missing closing ket> in <bra-ket> pair.
Show 5 quoted lines
> > +#ifndef ENABLE_SHA256
> > + if (fmt->hash_algo != GIT_HASH_SHA1)
> > + die(_("The hash algorithm %s is not supported in this build."), hash_algos[fmt->hash_algo].name);
>
> Could you fold the overlong line here?Show 9 quoted lines
> > int init_db(const char *git_dir, const char *real_git_dir,
> > - const char *template_dir, unsigned int flags)
> > + const char *template_dir, int hash, unsigned int flags)
>
> Perhaps rename "hash" to "hash_algo"? I know that it is very
> unlikely for a variable whose name is 'hash' to be mistaken as a raw
> hash value when its type is "int" (as opposed to say char *), but
> still. I wouldn't be saying this if its type were an "enum
> hash_algo" or something like that.
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204