On Wed, 11 Sep 2013, Nguyễn Thái Ngọc Duy wrote:

> While .idx v3 is recommended because it's smaller, there is no reason
> why .idx v2 can't use with .pack v4. Enable it, at least for the test
> suite as some tests need to this kind of information from show-index
> and show-index does not support .idx v3.

FYI, I've added that ability to show-index in my tree.  The output does 
not include the actual object SHA1 though.

[...]
> @@ -2167,6 +2170,9 @@ int cmd_index_pack(int argc, const char **argv, const 
> char *prefix)
>  
>       curr_pack = open_pack_file(pack_name);
>       parse_pack_header();
> +     if (!packv4 && opts.version >= 3)
> +             die(_("pack idx version %d does not work with pack version %d"),
> +                 opts.version, 4);

I don't think this is what you really meant here.  I've amended this 
patch with:

diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 4607dc6..f071ed9 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -2171,8 +2171,8 @@ int cmd_index_pack(int argc, const char **argv, const 
char *prefix)
        curr_pack = open_pack_file(pack_name);
        parse_pack_header();
        if (!packv4 && opts.version >= 3)
-               die(_("pack idx version %d does not work with pack version %d"),
-                   opts.version, 4);
+               die(_("pack idx version %d requires at least pack version 4"),
+                   opts.version);
        objects = xcalloc(nr_objects + 1, sizeof(struct object_entry));
        deltas = xcalloc(nr_objects, sizeof(struct delta_entry));
        parse_dictionaries();


Nicolas

Reply via email to