Re: [PATCH] repack: rewrite the shell script in C.
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 14, 2013, 07:26 UTC
- Message-ID
- <vpqy584n36a.fsf@anie.imag.fr>
- In-Reply-To
- <1376421797-26443-2-git-send-email-stefanbeller@googlemail.com>
Stefan Beller <stefanbeller@googlemail.com> writes:
> This is the beginning of the rewrite of the repacking.
(please, mark your patch as RFC/PATCH in the subject in this case)
A few quick comments on style below.
Show 6 quoted lines
> Makefile | 2 +- > builtin.h | 1 + > builtin/repack.c | 313 +++++++++++++++++++++++++++++++++++++++++ > contrib/examples/git-repack.sh | 194 +++++++++++++++++++++++++ > git-repack.sh | 194 ------------------------- > git.c | 1 +
I suggested that you first enrich the test suite if needed. Did you check that the testsuite had good enough coverage for git-repack?
> +static const char * const git_repack_usage[] = {Style: no space after *.
> +static int delta_base_offset = 1; // enabled by default since 22c79eab (2008-06-25)
No // comments please (they're C99, not portable C90).
> +int cmd_repack(int argc, const char **argv, const char *prefix) {Brace on the next line.
> + fname = xmalloc(strlen(packdir) + 47); // 40 chars for the sha1
> + fname_old = xmalloc(strlen(packdir) + 52); // 40 chars for the sha1
I'd rather have "40 + strlen("whatever")" explicitly.-- Matthieu Moy http://www-verimag.imag.fr/~moy/