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

Re: [PATCH 3/7] checkout-index: add parallel checkout support

From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Date
Apr 26, 2021, 22:30 UTC
Message-ID
<CAHd-oW547EXAg6bCFx84pKX0j_8Ry2RraYxVscNbK17+0ObkRA@mail.gmail.com>
In-Reply-To
<36615f6a-ce58-3737-8c1d-fa1253a85439@gmail.com>
On Fri, Apr 23, 2021 at 3:32 PM Derrick Stolee <stolee@gmail.com> wrote:
Show 28 quoted lines
>
> On 4/22/2021 11:17 AM, Matheus Tavares wrote:
> > @@ -142,11 +143,7 @@ static void checkout_all(const char *prefix, int prefix_length)
> >       }
> >       if (last_ce && to_tempfile)
> >               write_tempfile_record(last_ce->name, prefix);
> > -     if (errs)
> > -             /* we have already done our error reporting.
> > -              * exit with the same code as die().
> > -              */
> > -             exit(128);
>
> Here, it makes note of returning 128 as if it were a die(), but
>
> > +     if (all)
> > +             err |= checkout_all(prefix, prefix_length);
> > +
> > +     if (pc_workers > 1)
> > +             err |= run_parallel_checkout(&state, pc_workers, pc_threshold,
> > +                                          NULL, NULL);
> > +
> >       if (err)
> >               return 1;
>
> This returns 1 instead. Should we `return err` and use an error
> code specific to the response? I imagine there are other reasons
> that could cause a non-zero return for checkout_all() and
> run_parallel_checkout().

Hmm, I think checkout_entry() returns -1 for any kind of error, and checkout_all()'s `err` only holds the number of checkout_entry()'s failures. run_parallel_checkout() also always use -1 for errors.

> I suppose: is there a value in persisting the 128 response code
> here, or is an exit of 1 sufficient? There is no documentation
> about the exit code, so any dependence on 128 is not based on a
> "written promise" but I thought it was worth mentioning.

Yeah, I also wondered if we should keep the 128 exit code here... But I couldn't see much value in doing so, unless there are scripts actually expecting 128. But I guess this is unlikely, right?

The additional bonus of unifying the exit path for `git checkout-index --all` and `git checkout-index <path>` is that the code flow becomes a little easier to read, especially now that they both need to [conditionally] call run_parallel_checkout() before exiting.

Previous: Derrick StoleeNext: Matheus Tavares
Message 8 of 50 in “Parallel Checkout (part 3)”
  1. 0/7 Parallel Checkout (part 3)Matheus Tavares, Apr 22, 2021
  2. 1/7 make_transient_cache_entry(): optionally alloc from mem_poolMatheus Tavares, Apr 22, 2021
  3. 2/7 builtin/checkout.c: complete parallel checkout supportMatheus Tavares, Apr 22, 2021
  4. Derrick StoleeApr 23, 2021
  5. Matheus Tavares BernardinoApr 26, 2021
  6. 3/7 checkout-index: add parallel checkout supportMatheus Tavares, Apr 22, 2021
  7. Derrick StoleeApr 23, 2021
  8. Matheus Tavares BernardinoApr 26, 2021
  9. 4/7 parallel-checkout: add tests for basic operationsMatheus Tavares, Apr 22, 2021
  10. Derrick StoleeApr 23, 2021
  11. Matheus Tavares BernardinoApr 27, 2021
  12. 5/7 parallel-checkout: add tests related to path collisionsMatheus Tavares, Apr 22, 2021
  13. 6/7 parallel-checkout: add tests related to .gitattributesMatheus Tavares, Apr 22, 2021
  14. Derrick StoleeApr 23, 2021
  15. 7/7 ci: run test round with parallel-checkout enabledMatheus Tavares, Apr 22, 2021
  16. Derrick StoleeApr 23, 2021
  17. 0/8 Parallel Checkout (part 3)Matheus Tavares, Apr 30, 2021
  18. 1/8 make_transient_cache_entry(): optionally alloc from mem_poolMatheus Tavares, Apr 30, 2021
  19. Christian CouderMay 1, 2021
  20. Matheus Tavares BernardinoMay 3, 2021
  21. 2/8 builtin/checkout.c: complete parallel checkout supportMatheus Tavares, Apr 30, 2021
  22. Christian CouderMay 1, 2021
  23. Matheus Tavares BernardinoMay 3, 2021
  24. 3/8 checkout-index: add parallel checkout supportMatheus Tavares, Apr 30, 2021
  25. Christian CouderMay 1, 2021
  26. Matheus Tavares BernardinoMay 3, 2021
  27. 4/8 parallel-checkout: add tests for basic operationsMatheus Tavares, Apr 30, 2021
  28. 5/8 parallel-checkout: add tests related to path collisionsMatheus Tavares, Apr 30, 2021
  29. Torsten BögershausenMay 2, 2021
  30. Matheus Tavares BernardinoMay 3, 2021
  31. 6/8 t0028: extract encoding helpers to lib-encoding.shMatheus Tavares, Apr 30, 2021
  32. 7/8 parallel-checkout: add tests related to .gitattributesMatheus Tavares, Apr 30, 2021
  33. 8/8 ci: run test round with parallel-checkout enabledMatheus Tavares, Apr 30, 2021
  34. Torsten BögershausenMay 2, 2021
  35. Matheus Tavares BernardinoMay 3, 2021
  36. 0/8 Parallel Checkout (part 3)Matheus Tavares, May 4, 2021
  37. 1/8 make_transient_cache_entry(): optionally alloc from mem_poolMatheus Tavares, May 4, 2021
  38. 2/8 builtin/checkout.c: complete parallel checkout supportMatheus Tavares, May 4, 2021
  39. Derrick StoleeMay 5, 2021
  40. 3/8 checkout-index: add parallel checkout supportMatheus Tavares, May 4, 2021
  41. 4/8 parallel-checkout: add tests for basic operationsMatheus Tavares, May 4, 2021
  42. AIX failures on parallel checkout (new in v2.32.0-rc*)Ævar Arnfjörð Bjarmason, May 26, 2021
  43. Matheus Tavares BernardinoMay 26, 2021
  44. Junio C HamanoMay 26, 2021
  45. 5/8 parallel-checkout: add tests related to path collisionsMatheus Tavares, May 4, 2021
  46. 6/8 t0028: extract encoding helpers to lib-encoding.shMatheus Tavares, May 4, 2021
  47. 7/8 parallel-checkout: add tests related to .gitattributesMatheus Tavares, May 4, 2021
  48. 8/8 ci: run test round with parallel-checkout enabledMatheus Tavares, May 4, 2021
  49. Derrick StoleeMay 5, 2021
  50. Junio C HamanoMay 6, 2021

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.