Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installer: offer the built-in FSMonitor explicitly as an option #351

Merged
merged 2 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions 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 @@ -2249,7 +2254,7 @@ begin
* Create a custom page for experimental options.
*)

ExperimentalOptionsPage:=CreatePage(PrevPageID,'Configuring experimental options','Which bleeding-edge features would you like to enable?',TabOrder,Top,Left);
ExperimentalOptionsPage:=CreatePage(PrevPageID,'Configuring experimental options','These features are developed actively. Would you like to try them?',TabOrder,Top,Left);

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
RdbExperimentalOptions[GP_BuiltinDifftool]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental, builtin difftool','Use the experimental builtin difftool (fast, but only lightly tested).',TabOrder,Top,Left);
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