diff options
author | Lars Schneider <larsxschneider@gmail.com> | 2017-06-30 22:41:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-30 13:50:41 -0700 |
commit | 2841e8f81cb2820024804b9341577be1d0ce1240 (patch) | |
tree | 21a9a9a8528b07bbd516ff1384156a20ea5f8464 /cache.h | |
parent | 1514c8edd62d96006cd1de31e906ed5798dd4681 (diff) | |
download | git-2841e8f81cb2820024804b9341577be1d0ce1240.tar.gz |
convert: add "status=delayed" to filter process protocol
Some `clean` / `smudge` filters may require a significant amount of
time to process a single blob (e.g. the Git LFS smudge filter might
perform network requests). During this process the Git checkout
operation is blocked and Git needs to wait until the filter is done to
continue with the checkout.
Teach the filter process protocol, introduced in edcc8581 ("convert: add
filter.<driver>.process option", 2016-10-16), to accept the status
"delayed" as response to a filter request. Upon this response Git
continues with the checkout operation. After the checkout operation Git
calls "finish_delayed_checkout" which queries the filter for remaining
blobs. If the filter is still working on the completion, then the filter
is expected to block. If the filter has completed all remaining blobs
then an empty response is expected.
Git has a multiple code paths that checkout a blob. Support delayed
checkouts only in `clone` (in unpack-trees.c) and `checkout` operations
for now. The optimization is most effective in these code paths as all
files of the tree are processed.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1544,6 +1544,7 @@ struct checkout { struct index_state *istate; const char *base_dir; int base_dir_len; + struct delayed_checkout *delayed_checkout; unsigned force:1, quiet:1, not_new:1, @@ -1553,6 +1554,8 @@ struct checkout { #define TEMPORARY_FILENAME_LENGTH 25 extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath); +extern void enable_delayed_checkout(struct checkout *state); +extern int finish_delayed_checkout(struct checkout *state); struct cache_def { struct strbuf path; |