git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 3/5] pack-objects: add delta-islands support

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 22, 2018, 08:55 UTC
Message-ID
<CACsJy8CmJt1Wj=e4TNUUxY-Czn+h0BTVAWLY0ujJhgUKC+Y6yw@mail.gmail.com>
In-Reply-To
<20180722054836.28935-4-chriscool@tuxfamily.org>

On Sun, Jul 22, 2018 at 7:52 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 50 quoted lines
> @@ -700,51 +705,58 @@ static struct object_entry **compute_write_order(void)
>          */
>         for_each_tag_ref(mark_tagged, NULL);
>
> -       /*
> -        * Give the objects in the original recency order until
> -        * we see a tagged tip.
> -        */
> +       if (use_delta_islands)
> +               max_layers = compute_pack_layers(&to_pack);
> +
>         ALLOC_ARRAY(wo, to_pack.nr_objects);
> -       for (i = wo_end = 0; i < to_pack.nr_objects; i++) {
> -               if (objects[i].tagged)
> -                       break;
> -               add_to_write_order(wo, &wo_end, &objects[i]);
> -       }
> -       last_untagged = i;
> +       wo_end = 0;
>
> -       /*
> -        * Then fill all the tagged tips.
> -        */
> -       for (; i < to_pack.nr_objects; i++) {
> -               if (objects[i].tagged)
> +       for (; write_layer < max_layers; ++write_layer) {
> +               /*
> +                * Give the objects in the original recency order until
> +                * we see a tagged tip.
> +                */
> +               for (i = 0; i < to_pack.nr_objects; i++) {
> +                       if (objects[i].tagged)
> +                               break;
>                         add_to_write_order(wo, &wo_end, &objects[i]);
> -       }
> +               }
> +               last_untagged = i;
>
> -       /*
> -        * And then all remaining commits and tags.
> -        */
> -       for (i = last_untagged; i < to_pack.nr_objects; i++) {
> -               if (oe_type(&objects[i]) != OBJ_COMMIT &&
> -                   oe_type(&objects[i]) != OBJ_TAG)
> -                       continue;
> -               add_to_write_order(wo, &wo_end, &objects[i]);
> -       }
> +               /*
> +                * Then fill all the tagged tips.
> +                */

If we move the code in this loop to a separate function, in a separate patch, first, would it produce a better diff? I think all the indentation change here makes it a bit hard to read.

> +               for (; i < to_pack.nr_objects; i++) {
> +                       if (objects[i].tagged)
> +                               add_to_write_order(wo, &wo_end, &objects[i]);
> +               }
-- 
Duy
Previous: Christian CouderNext: Christian Couder
Message 20 of 37 in “Add delta islands support”
  1. 0/5 Add delta islands supportChristian Couder, Jul 22, 2018
  2. 1/5 packfile: make get_delta_base() non staticChristian Couder, Jul 22, 2018
  3. Junio C HamanoJul 24, 2018
  4. Jeff KingJul 27, 2018
  5. 2/5 Add delta-islands.{c,h}Christian Couder, Jul 22, 2018
  6. Duy NguyenJul 22, 2018
  7. Christian CouderJul 22, 2018
  8. Christian CouderAug 5, 2018
  9. Jeff KingAug 6, 2018
  10. Duy NguyenAug 6, 2018
  11. Christian CouderAug 6, 2018
  12. Duy NguyenAug 6, 2018
  13. Junio C HamanoJul 24, 2018
  14. Jeff KingJul 27, 2018
  15. Jeff KingJul 27, 2018
  16. 4/5 repack: add delta-islands supportChristian Couder, Jul 22, 2018
  17. 5/5 t: add t9930-delta-islands.shChristian Couder, Jul 22, 2018
  18. Jeff KingJul 24, 2018
  19. 3/5 pack-objects: add delta-islands supportChristian Couder, Jul 22, 2018
  20. Duy NguyenJul 22, 2018
  21. Christian CouderAug 5, 2018
  22. Stefan BellerJul 23, 2018
  23. Jeff KingJul 24, 2018
  24. Stefan BellerJul 24, 2018
  25. Jeff KingJul 27, 2018
  26. Stefan BellerJul 27, 2018
  27. Jeff KingJul 28, 2018
  28. Christian CouderJul 28, 2018
  29. Junio C HamanoJul 24, 2018
  30. Junio C HamanoJul 24, 2018
  31. Christian CouderAug 5, 2018
  32. Christian CouderAug 6, 2018
  33. Jeff KingAug 6, 2018
  34. Jeff KingJul 24, 2018
  35. Junio C HamanoJul 24, 2018
  36. Jeff KingJul 24, 2018
  37. Johannes SchindelinJul 26, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.