Re: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension.
On 9/17/2017 4:03 AM, Junio C Hamano wrote: Ben Peartwrites: +[[fsmonitor-watchman]] +fsmonitor-watchman +~~~ I've queued a mini squash on top to make sure the line aligns with the length of the string above it by adding three ~'s here. Thanks, I'll do the same assuming there will be another re-roll.
Re: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension.
On 9/15/2017 3:43 PM, David Turner wrote: -Original Message- From: Ben Peart [mailto:benpe...@microsoft.com] Sent: Friday, September 15, 2017 3:21 PM To: benpe...@microsoft.com Cc: David Turner <david.tur...@twosigma.com>; ava...@gmail.com; christian.cou...@gmail.com; git@vger.kernel.org; gits...@pobox.com; johannes.schinde...@gmx.de; pclo...@gmail.com; p...@peff.net Subject: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension. This includes the core.fsmonitor setting, the query-fsmonitor hook, and the fsmonitor index extension. Signed-off-by: Ben Peart <benpe...@microsoft.com> --- Documentation/config.txt | 6 ++ Documentation/githooks.txt | 23 +++ Documentation/technical/index-format.txt | 19 +++ 3 files changed, 48 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index dc4e3f58a2..c196007a27 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -413,6 +413,12 @@ core.protectNTFS:: 8.3 "short" names. Defaults to `true` on Windows, and `false` elsewhere. +core.fsmonitor:: + If set, the value of this variable is used as a command which + will identify all files that may have changed since the + requested date/time. This information is used to speed up git by + avoiding unnecessary processing of files that have not changed. I'm confused here. You have a file called "fsmonitor-watchman", which seems to discuss the protocol for core.fsmonitor scripts in general, and you have this documentation, which does not link to that file. Can you clarify this? I'll add the missing link to the documentation in githooks.txt. The documentation should be enough for someone to develop another integration script. The fsmonitor-watchman script allows people to easily use this patch series with the existing Watchman monitor but it can certainly also be used as a sample for how to integrate with another file system monitor. +The hook should output to stdout the list of all files in the working +directory that may have changed since the requested time. The logic +should be inclusive so that it does not miss any potential changes. +"It is OK to include files which have not actually changed. Newly-created and deleted files should also be included. When files are renamed, both the old and the new name should be included." Also, please discuss case sensitivity issues (e.g. on OS X). +The paths should be relative to the root of the working directory and +be separated by a single NUL. + - 32-bit version number: the current supported version is 1. + + - 64-bit time: the extension data reflects all changes through the given + time which is stored as the nanoseconds elapsed since midnight, + January 1, 1970. Nit: Please specify signed or unsigned for these. (I expect to be getting out of cryosleep around 2262, and I want to know if my old git repos will keep working...) While I'm not opposed to specifying unsigned, I did notice that the only place signed/unsigned is specified today is in "index entry." Everywhere else doesn't specify so I left it off for consistency. I've not seen negative version numbers nor negative time so am not entirely sure it is necessary to clarify. :) + - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. + + - An ewah bitmap, the n-th bit indicates whether the n-th index entry +is not CE_FSMONITOR_VALID.
Re: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension.
Ben Peartwrites: > +[[fsmonitor-watchman]] > +fsmonitor-watchman > +~~~ I've queued a mini squash on top to make sure the line aligns with the length of the string above it by adding three ~'s here.
RE: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension.
> -Original Message- > From: Ben Peart [mailto:benpe...@microsoft.com] > Sent: Friday, September 15, 2017 3:21 PM > To: benpe...@microsoft.com > Cc: David Turner <david.tur...@twosigma.com>; ava...@gmail.com; > christian.cou...@gmail.com; git@vger.kernel.org; gits...@pobox.com; > johannes.schinde...@gmx.de; pclo...@gmail.com; p...@peff.net > Subject: [PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor > extension. > > This includes the core.fsmonitor setting, the query-fsmonitor hook, and the > fsmonitor index extension. > > Signed-off-by: Ben Peart <benpe...@microsoft.com> > --- > Documentation/config.txt | 6 ++ > Documentation/githooks.txt | 23 +++ > Documentation/technical/index-format.txt | 19 +++ > 3 files changed, 48 insertions(+) > > diff --git a/Documentation/config.txt b/Documentation/config.txt index > dc4e3f58a2..c196007a27 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -413,6 +413,12 @@ core.protectNTFS:: > 8.3 "short" names. > Defaults to `true` on Windows, and `false` elsewhere. > > +core.fsmonitor:: > + If set, the value of this variable is used as a command which > + will identify all files that may have changed since the > + requested date/time. This information is used to speed up git by > + avoiding unnecessary processing of files that have not changed. I'm confused here. You have a file called "fsmonitor-watchman", which seems to discuss the protocol for core.fsmonitor scripts in general, and you have this documentation, which does not link to that file. Can you clarify this? > +The hook should output to stdout the list of all files in the working > +directory that may have changed since the requested time. The logic > +should be inclusive so that it does not miss any potential changes. +"It is OK to include files which have not actually changed. Newly-created and deleted files should also be included. When files are renamed, both the old and the new name should be included." Also, please discuss case sensitivity issues (e.g. on OS X). > +The paths should be relative to the root of the working directory and > +be separated by a single NUL. > + - 32-bit version number: the current supported version is 1. > + > + - 64-bit time: the extension data reflects all changes through the given > + time which is stored as the nanoseconds elapsed since midnight, > + January 1, 1970. Nit: Please specify signed or unsigned for these. (I expect to be getting out of cryosleep around 2262, and I want to know if my old git repos will keep working...) > + - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. > + > + - An ewah bitmap, the n-th bit indicates whether the n-th index entry > +is not CE_FSMONITOR_VALID.
[PATCH v6 05/12] fsmonitor: add documentation for the fsmonitor extension.
This includes the core.fsmonitor setting, the query-fsmonitor hook, and the fsmonitor index extension. Signed-off-by: Ben Peart--- Documentation/config.txt | 6 ++ Documentation/githooks.txt | 23 +++ Documentation/technical/index-format.txt | 19 +++ 3 files changed, 48 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index dc4e3f58a2..c196007a27 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -413,6 +413,12 @@ core.protectNTFS:: 8.3 "short" names. Defaults to `true` on Windows, and `false` elsewhere. +core.fsmonitor:: + If set, the value of this variable is used as a command which + will identify all files that may have changed since the + requested date/time. This information is used to speed up git by + avoiding unnecessary processing of files that have not changed. + core.trustctime:: If false, the ctime differences between the index and the working tree are ignored; useful when the inode change time diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 1bb4f92d4d..da82d64b0b 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -456,6 +456,29 @@ non-zero status causes 'git send-email' to abort before sending any e-mails. +[[fsmonitor-watchman]] +fsmonitor-watchman +~~~ + +This hook is invoked when the configuration option core.fsmonitor is +set to .git/hooks/fsmonitor-watchman. It takes two arguments, a version +(currently 1) and the time in elapsed nanoseconds since midnight, +January 1, 1970. + +The hook should output to stdout the list of all files in the working +directory that may have changed since the requested time. The logic +should be inclusive so that it does not miss any potential changes. +The paths should be relative to the root of the working directory +and be separated by a single NUL. + +Git will limit what files it checks for changes as well as which +directories are checked for untracked files based on the path names +given. + +The exit status determines whether git will use the data from the +hook to limit its search. On error, it will fall back to verifying +all files and folders. + GIT --- Part of the linkgit:git[1] suite diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt index ade0b0c445..db3572626b 100644 --- a/Documentation/technical/index-format.txt +++ b/Documentation/technical/index-format.txt @@ -295,3 +295,22 @@ The remaining data of each directory block is grouped by type: in the previous ewah bitmap. - One NUL. + +== File System Monitor cache + + The file system monitor cache tracks files for which the core.fsmonitor + hook has told us about changes. The signature for this extension is + { 'F', 'S', 'M', 'N' }. + + The extension starts with + + - 32-bit version number: the current supported version is 1. + + - 64-bit time: the extension data reflects all changes through the given + time which is stored as the nanoseconds elapsed since midnight, + January 1, 1970. + + - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. + + - An ewah bitmap, the n-th bit indicates whether the n-th index entry +is not CE_FSMONITOR_VALID. -- 2.14.1.548.ge54b1befee.dirty