Re: [PATCH] repack: Add --version parameter
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Sep 26, 2013, 10:17 UTC
- Message-ID
- <CAMP44s0E7=fupwfe=rm9yETmzdjFyH8vuyWY=Ce4wKg=g4-iJg@mail.gmail.com>
- In-Reply-To
- <1380184349-26380-1-git-send-email-stefanbeller@googlemail.com>
On Thu, Sep 26, 2013 at 3:32 AM, Stefan Beller <stefanbeller@googlemail.com> wrote:
Show 37 quoted lines
> This is just a direct translation of
> http://article.gmane.org/gmane.comp.version-control.git/235396
> So I don't consider this is ready for inclusion.
>
> Some notes:
> We need to have more error checking, repack shall be 0, 2 or 4 but nothing
> else. If 0 is given, no argument is passed to pack-objects, in case of
> 2 or 4 --version=<n> is passed.
>
> Do we really want to call it "--version"? This parameter sounds so much
> like questioning for the program version, similar to
> git --version
> 1.8.4
> So I'd rather use "--repack-version".
> ---
> builtin/repack.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/builtin/repack.c b/builtin/repack.c
> index 3e56614..fd05e9a 100644
> --- a/builtin/repack.c
> +++ b/builtin/repack.c
> @@ -9,6 +9,7 @@
> #include "argv-array.h"
>
> static int delta_base_offset = 1;
> +static int pack_version;
> static char *packdir, *packtmp;
>
> static const char *const git_repack_usage[] = {
> @@ -22,6 +23,9 @@ static int repack_config(const char *var, const char *value, void *cb)
> delta_base_offset = git_config_bool(var, value);
> return 0;
> }
> + if (!strcmp(var, "core.preferredPackVersion")) {
> + pack_version = git_config_int(var, value);
> + }The style is without braces if the block is a single line.
-- Felipe Contreras