Skip to content

Commit

Permalink
installer: offer the built-in FSMonitor explicitly as an option
Browse files Browse the repository at this point in the history
The built-in FSMonitor was included in Git for Windows v2.31.0 already,
but judging from the lack of bug reports, not many users found out about
the fact that it exists.

Let's change that.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed May 28, 2021
1 parent ad73f91 commit b513558
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
29 changes: 28 additions & 1 deletion installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,18 @@ const
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif
#ifdef WITH_EXPERIMENTAL_BUILTIN_FSMONITOR
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Experimental options
GP_BuiltinDifftool = 1;
GP_BuiltinRebase = 2;
GP_BuiltinStash = 3;
GP_BuiltinAddI = 4;
GP_EnablePCon = 5;
GP_EnableFSMonitor = 6;
#endif
var
Expand Down Expand Up @@ -496,7 +501,7 @@ var
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Wizard page and variables for the experimental options.
ExperimentalOptionsPage:TWizardPage;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_EnablePCon] of TCheckBox;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_EnableFSMonitor] of TCheckBox;
#endif
// Mapping controls to hyperlinks
Expand Down Expand Up @@ -2286,6 +2291,13 @@ begin
RdbExperimentalOptions[GP_EnablePCon].Checked:=ReplayChoice('Enable Pseudo Console Support','Auto')='Enabled';
#endif
#ifdef WITH_EXPERIMENTAL_BUILTIN_FSMONITOR
RdbExperimentalOptions[GP_EnableFSMonitor]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental built-in file system monitor','<RED>(NEW!)</RED> Automatically run a built-in file system watcher, to speed up common'+#13+'operations such as `git status`, `git add`, `git commit`, etc in worktrees'+#13+'containing many files.',TabOrder,Top,Left);
// Restore the settings chosen during a previous install
RdbExperimentalOptions[GP_EnableFSMonitor].Checked:=ReplayChoice('Enable FSMonitor','Auto')='Enabled';
#endif
#endif
PageIDBeforeInstall:=CurrentCustomPageID;
Expand Down Expand Up @@ -3032,6 +3044,13 @@ begin
LogError('Could not write to '+ExpandConstant('{app}\etc\git-bash.config'));
#endif
#ifdef WITH_EXPERIMENTAL_BUILTIN_FSMONITOR
if RdbExperimentalOptions[GP_EnableFSMonitor].checked then
GitSystemConfigSet('core.useBuiltinFSMonitor','true')
else
GitSystemConfigSet('core.useBuiltinFSMonitor',#0);
#endif
{
Modify the environment
Expand Down Expand Up @@ -3422,6 +3441,14 @@ begin
RecordChoice(PreviousDataKey,'Enable Pseudo Console Support',Data);
#endif
#ifdef WITH_EXPERIMENTAL_BUILTIN_FSMONITOR
Data:='Disabled';
if RdbExperimentalOptions[GP_EnableFSMonitor].Checked then begin
Data:='Enabled';
end;
RecordChoice(PreviousDataKey,'Enable FSMonitor',Data);
#endif
Path:=ExpandConstant('{app}\etc\install-options.txt');
if not SaveStringToFile(Path,ChosenOptions,False) then
LogError('Could not write to '+Path);
Expand Down
5 changes: 5 additions & 0 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ then
inno_defines="$inno_defines$LF#define WITH_EXPERIMENTAL_PCON 1"
fi

if test -n "$(git version --build-options | grep fsmonitor--daemon)"
then
inno_defines="$inno_defines$LF#define WITH_EXPERIMENTAL_BUILTIN_FSMONITOR 1"
fi

GITCONFIG_PATH="$(echo "$LIST" | grep "^$etc_gitconfig\$")"
test -z "$GITCONFIG_PATH" || {
keys="$(git config -f "/$GITCONFIG_PATH" -l --name-only)" &&
Expand Down

0 comments on commit b513558

Please sign in to comment.