Merge branch 'ls/filter-process-delayed' into jt/subprocess-handshake
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Jul 2017 19:56:19 +0000 (12:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Jul 2017 19:56:19 +0000 (12:56 -0700)
* ls/filter-process-delayed:
  convert: add "status=delayed" to filter process protocol
  convert: refactor capabilities negotiation
  convert: move multiple file filter error handling to separate function
  convert: put the flags field before the flag itself for consistent style
  t0021: write "OUT <size>" only on success
  t0021: make debug log file name configurable
  t0021: keep filter log files on comparison

1  2 
Documentation/gitattributes.txt
builtin/checkout.c
cache.h
convert.c
convert.h
unpack-trees.c

Simple merge
Simple merge
diff --cc cache.h
Simple merge
diff --cc convert.c
+++ b/convert.c
@@@ -1122,10 -1204,10 +1212,10 @@@ void convert_to_git_filter_fd(const str
        assert(ca.drv);
        assert(ca.drv->clean || ca.drv->process);
  
-       if (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN))
+       if (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN, NULL))
                die("%s: clean filter '%s' failed", path, ca.drv->name);
  
 -      crlf_to_git(path, dst->buf, dst->len, dst, ca.crlf_action, checksafe);
 +      crlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, checksafe);
        ident_to_git(path, dst->buf, dst->len, dst, ca.ident);
  }
  
@@@ -1163,15 -1246,21 +1254,22 @@@ static int convert_to_working_tree_inte
        return ret | ret_filter;
  }
  
+ int async_convert_to_working_tree(const char *path, const char *src,
+                                 size_t len, struct strbuf *dst,
+                                 void *dco)
+ {
+       return convert_to_working_tree_internal(path, src, len, dst, 0, dco);
+ }
  int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst)
  {
-       return convert_to_working_tree_internal(path, src, len, dst, 0);
+       return convert_to_working_tree_internal(path, src, len, dst, 0, NULL);
  }
  
 -int renormalize_buffer(const char *path, const char *src, size_t len, struct strbuf *dst)
 +int renormalize_buffer(const struct index_state *istate, const char *path,
 +                     const char *src, size_t len, struct strbuf *dst)
  {
-       int ret = convert_to_working_tree_internal(path, src, len, dst, 1);
+       int ret = convert_to_working_tree_internal(path, src, len, dst, 1, NULL);
        if (ret) {
                src = dst->buf;
                len = dst->len;
diff --cc convert.h
+++ b/convert.h
@@@ -4,8 -4,8 +4,10 @@@
  #ifndef CONVERT_H
  #define CONVERT_H
  
+ #include "string-list.h"
 +struct index_state;
 +
  enum safe_crlf {
        SAFE_CRLF_FALSE = 0,
        SAFE_CRLF_FAIL = 1,
@@@ -34,9 -34,28 +36,29 @@@ enum eol 
  #endif
  };
  
+ enum ce_delay_state {
+       CE_NO_DELAY = 0,
+       CE_CAN_DELAY = 1,
+       CE_RETRY = 2
+ };
+ struct delayed_checkout {
+       /*
+        * State of the currently processed cache entry. If the state is
+        * CE_CAN_DELAY, then the filter can delay the current cache entry.
+        * If the state is CE_RETRY, then this signals the filter that the
+        * cache entry was requested before.
+        */
+       enum ce_delay_state state;
+       /* List of filter drivers that signaled delayed blobs. */
+       struct string_list filters;
+       /* List of delayed blobs identified by their path. */
+       struct string_list paths;
+ };
  extern enum eol core_eol;
 -extern const char *get_cached_convert_stats_ascii(const char *path);
 +extern const char *get_cached_convert_stats_ascii(const struct index_state *istate,
 +                                                const char *path);
  extern const char *get_wt_convert_stats_ascii(const char *path);
  extern const char *get_convert_attr_ascii(const char *path);
  
@@@ -46,17 -64,18 +68,21 @@@ extern int convert_to_git(const struct 
                          struct strbuf *dst, enum safe_crlf checksafe);
  extern int convert_to_working_tree(const char *path, const char *src,
                                   size_t len, struct strbuf *dst);
 -extern int renormalize_buffer(const char *path, const char *src, size_t len,
+ extern int async_convert_to_working_tree(const char *path, const char *src,
+                                        size_t len, struct strbuf *dst,
+                                        void *dco);
+ extern int async_query_available_blobs(const char *cmd, struct string_list *available_paths);
 +extern int renormalize_buffer(const struct index_state *istate,
 +                            const char *path, const char *src, size_t len,
                              struct strbuf *dst);
 -static inline int would_convert_to_git(const char *path)
 +static inline int would_convert_to_git(const struct index_state *istate,
 +                                     const char *path)
  {
 -      return convert_to_git(path, NULL, 0, NULL, 0);
 +      return convert_to_git(istate, path, NULL, 0, NULL, 0);
  }
  /* Precondition: would_convert_to_git_filter_fd(path) == true */
 -extern void convert_to_git_filter_fd(const char *path, int fd,
 +extern void convert_to_git_filter_fd(const struct index_state *istate,
 +                                   const char *path, int fd,
                                     struct strbuf *dst,
                                     enum safe_crlf checksafe);
  extern int would_convert_to_git_filter_fd(const char *path);
diff --cc unpack-trees.c
Simple merge