Subject: Re: [PATCH] repack: rewrite the shell script in C.

From: Matthieu Moy <[email-masked]>
Date: Wed, 14 Aug 2013 09:26:37 +0200

Stefan Beller <[email-masked]> 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.

>  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/