mbox series

[v2,0/5] Builtin FSMonitor Part 2

Message ID pull.1041.v2.git.1633614772.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Builtin FSMonitor Part 2 | expand

Message

Usman Akinyemi via GitGitGadget Oct. 7, 2021, 1:52 p.m. UTC
Here is V2 of Part 2 of my Builtin FSMonitor series.

This version has been rebased onto "next" because it collided with a change
"repo-settings.c" from "ab/repo-settings-cleanup". And the third commit was
updated to resolve those conflicts.

It also requires "jh/builtin-fsmonitor-part1" which is now in "next".

Part 2 contains:

Client-side code to connect to a (yet to be developed) FSMonitor daemon over
Simple IPC (using Named Pipes or Unix Domain Sockets).

Updated config settings to allow the client to decide whether to use Simple
IPC or the existing FSMonitor Hook API. This includes retiring the existing
"core_fsmonitor" global variable that had confusing double-duty.

Part 2 essentially enables client-side code to talk to different types of
providers of FS change data. Processing of that data is unchanged.

A builtin FSMonitor daemon will be added in a later patch series.

Jeff Hostetler (5):
  fsmonitor: enhance existing comments
  fsmonitor-ipc: create client routines for git-fsmonitor--daemon
  fsmonitor: config settings are repository-specific
  fsmonitor: use IPC to query the builtin FSMonitor daemon
  fsmonitor: update fsmonitor config documentation

 Documentation/config/core.txt      |  56 ++++++---
 Documentation/git-update-index.txt |  27 +++--
 Documentation/githooks.txt         |   3 +-
 Makefile                           |   2 +
 builtin/update-index.c             |  19 +++-
 cache.h                            |   1 -
 config.c                           |  14 ---
 config.h                           |   1 -
 environment.c                      |   1 -
 fsmonitor-ipc.c                    | 176 +++++++++++++++++++++++++++++
 fsmonitor-ipc.h                    |  48 ++++++++
 fsmonitor-settings.c               |  97 ++++++++++++++++
 fsmonitor-settings.h               |  21 ++++
 fsmonitor.c                        | 130 +++++++++++++++------
 fsmonitor.h                        |  18 ++-
 repo-settings.c                    |   2 +
 repository.h                       |   3 +
 t/README                           |   4 +-
 18 files changed, 538 insertions(+), 85 deletions(-)
 create mode 100644 fsmonitor-ipc.c
 create mode 100644 fsmonitor-ipc.h
 create mode 100644 fsmonitor-settings.c
 create mode 100644 fsmonitor-settings.h


base-commit: 6e70778dc91e2139466c15ff15a02a22a2ada2d1
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1041%2Fjeffhostetler%2Fbuiltin-fsmonitor-part2-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1041/jeffhostetler/builtin-fsmonitor-part2-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1041

Range-diff vs v1:

 1:  6be687ba39d = 1:  cb25eeaf72d fsmonitor: enhance existing comments
 2:  b584f133d28 = 2:  df81a63acee fsmonitor-ipc: create client routines for git-fsmonitor--daemon
 3:  f1266c99adf ! 3:  7d5a353e74d fsmonitor: config settings are repository-specific
     @@ config.c: int git_config_get_max_percent_split_change(void)
       	int is_bool, val;
      
       ## config.h ##
     -@@ config.h: int git_config_get_index_threads(int *dest);
     - int git_config_get_untracked_cache(void);
     +@@ config.h: int git_config_get_pathname(const char *key, const char **dest);
     + int git_config_get_index_threads(int *dest);
       int git_config_get_split_index(void);
       int git_config_get_max_percent_split_change(void);
      -int git_config_get_fsmonitor(void);
     @@ fsmonitor.h: static inline void mark_fsmonitor_valid(struct index_state *istate,
      
       ## repo-settings.c ##
      @@ repo-settings.c: void prepare_repo_settings(struct repository *r)
     - 	UPDATE_DEFAULT_BOOL(r->settings.commit_graph_read_changed_paths, 1);
     - 	UPDATE_DEFAULT_BOOL(r->settings.gc_write_commit_graph, 1);
     + 	if (r->settings.initialized++)
     + 		return;
       
      +	r->settings.fsmonitor = NULL; /* lazy loaded */
      +
     - 	if (!repo_config_get_int(r, "index.version", &value))
     - 		r->settings.index_version = value;
     - 	if (!repo_config_get_maybe_bool(r, "core.untrackedcache", &value)) {
     + 	/* Defaults */
     + 	r->settings.index_version = -1;
     + 	r->settings.core_untracked_cache = UNTRACKED_CACHE_KEEP;
      
       ## repository.h ##
      @@
     @@ repository.h
       struct index_state;
       struct lock_file;
      @@ repository.h: struct repo_settings {
     - 	int gc_write_commit_graph;
     - 	int fetch_write_commit_graph;
     + 	int command_requires_full_index;
     + 	int sparse_index;
       
      +	struct fsmonitor_settings *fsmonitor; /* lazy loaded */
      +
 4:  f2e5da9e5c6 = 4:  8608c8718d8 fsmonitor: use IPC to query the builtin FSMonitor daemon
 5:  fb5251e47ae = 5:  7c22ce53377 fsmonitor: update fsmonitor config documentation