Thread (48 messages) 48 messages, 5 authors, 2021-05-26

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

From: Christian Couder <hidden>
Date: 2021-05-01 17:08:46

On Fri, Apr 30, 2021 at 11:40 PM Matheus Tavares
[off-list ref] wrote:
Note: previously, `checkout_all()` would not return on errors, but
s/Note: previously/Previously/
instead call `exit()` with a non-zero code. However, it only did that
after calling `checkout_entry()` for all index entries, thus not
stopping on the first error, but attempting to write the maximum number
of entries possible. In order to maintain this behavior we now propagate
`checkout_all()`s error status to `cmd_checkout_index()`, so that it can
call `run_parallel_checkout()` and attempt to write the queued entries
before exiting with the error code.

Signed-off-by: Matheus Tavares <redacted>
quoted hunk ↗ jump to hunk
@@ -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);
So when there were errors in checkout_all(), we used to exit() with
error code 128 (same as die())...
quoted hunk ↗ jump to hunk
@@ -275,12 +277,16 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                strbuf_release(&buf);
        }

+       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;
...but now it looks like we will exit with error code 1. I see that
you already answered this comment in the previous round of review, but
you didn't add the explanations to the commit message.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help