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 builtin stash/rebase as experimental options #203

Merged
merged 1 commit into from
Aug 28, 2018
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
77 changes: 73 additions & 4 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,22 @@ const
GP_Symlinks = 3;

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_REBASE
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_STASH
#define HAVE_EXPERIMENTAL_OPTIONS 1
#endif

#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Experimental options
GP_BuiltinDifftool = 1;
GP_BuiltinRebase = 2;
GP_BuiltinStash = 3;
#endif

var
Expand Down Expand Up @@ -385,10 +399,10 @@ var
ExtraOptionsPage:TWizardPage;
RdbExtraOptions:array[GP_FSCache..GP_Symlinks] of TCheckBox;

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
#ifdef HAVE_EXPERIMENTAL_OPTIONS
// Wizard page and variables for the experimental options.
ExperimentalOptionsPage:TWizardPage;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_BuiltinDifftool] of TCheckBox;
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_BuiltinStash] of TCheckBox;
#endif

// Mapping controls to hyperlinks
Expand Down Expand Up @@ -1382,18 +1396,37 @@ begin

RdbExtraOptions[GP_Symlinks].Checked:=Data<>'Disabled';

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
#ifdef HAVE_EXPERIMENTAL_OPTIONS
(*
* 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);

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
// 1st option
RdbExperimentalOptions[GP_BuiltinDifftool]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental, builtin difftool','Use the experimental builtin difftool (fast, but only lightly tested).',TabOrder,Top,Left);

// Restore the settings chosen during a previous install
RdbExperimentalOptions[GP_BuiltinDifftool].Checked:=ReplayChoice('Enable Builtin Difftool','Auto')='Enabled';
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_REBASE
// 2nd option
RdbExperimentalOptions[GP_BuiltinRebase]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental, built-in rebase','<RED>(NEW!)</RED> Use the experimental built-in rebase (about 70% faster, but only'+#13+'lightly tested).',TabOrder,Top,Left);

// Restore the settings chosen during a previous install
RdbExperimentalOptions[GP_BuiltinRebase].Checked:=ReplayChoice('Enable Builtin Rebase','Auto')='Disabled';
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_STASH
// 3rd option
RdbExperimentalOptions[GP_BuiltinStash]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental, built-in stash','<RED>(NEW!)</RED> Use the experimental built-in stash (about 90% faster, but only'+#13+'lightly tested).',TabOrder,Top,Left);

// Restore the settings chosen during a previous install
RdbExperimentalOptions[GP_BuiltinStash].Checked:=ReplayChoice('Enable Builtin Stash','Auto')='Disabled';
#endif

#endif

(*
Expand Down Expand Up @@ -1431,7 +1464,7 @@ begin
// This button is only used by the uninstaller.
ContinueButton:=NIL;

#ifdef WITH_EXPERIMENTAL_BUILTIN_DIFFTOOL
#ifdef HAVE_EXPERIMENTAL_OPTIONS
PageIDBeforeInstall:=ExperimentalOptionsPage.ID;
#else
PageIDBeforeInstall:=ExtraOptionsPage.ID;
Expand Down Expand Up @@ -1987,6 +2020,26 @@ begin
end;
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_REBASE
if RdbExperimentalOptions[GP_BuiltinRebase].checked then begin
if not Exec(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --system rebase.useBuiltin true','',SW_HIDE,ewWaitUntilTerminated, i) then
LogError('Could not configure rebase.useBuiltin')
end else begin
if not Exec(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --system --unset rebase.useBuiltin','',SW_HIDE,ewWaitUntilTerminated, i) then
LogError('Could not configure rebase.useBuiltin')
end;
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_STASH
if RdbExperimentalOptions[GP_BuiltinStash].checked then begin
if not Exec(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --system stash.useBuiltin true','',SW_HIDE,ewWaitUntilTerminated, i) then
LogError('Could not configure stash.useBuiltin')
end else begin
if not Exec(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --system --unset stash.useBuiltin','',SW_HIDE,ewWaitUntilTerminated, i) then
LogError('Could not configure stash.useBuiltin')
end;
#endif

{
Modify the environment

Expand Down Expand Up @@ -2268,6 +2321,22 @@ begin
RecordChoice(PreviousDataKey,'Enable Builtin Difftool',Data);
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_REBASE
Data:='Disabled';
if RdbExperimentalOptions[GP_BuiltinRebase].Checked then begin
Data:='Enabled';
end;
RecordChoice(PreviousDataKey,'Enable Builtin Rebase',Data);
#endif

#ifdef WITH_EXPERIMENTAL_BUILTIN_STASH
Data:='Disabled';
if RdbExperimentalOptions[GP_BuiltinStash].Checked then begin
Data:='Enabled';
end;
RecordChoice(PreviousDataKey,'Enable Builtin Stash',Data);
#endif

Path:=ExpandConstant('{app}\etc\install-options.txt');
if not SaveStringToFile(Path,ChosenOptions,False) then
LogError('Could not write to '+Path);
Expand Down
14 changes: 14 additions & 0 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ case "$LIST" in
;;
esac

case "$LIST" in
*/libexec/git-core/git-legacy-rebase*)
inno_defines="$(printf "%s\n%s" "$inno_defines" \
"#define WITH_EXPERIMENTAL_BUILTIN_REBASE 1")"
;;
esac

case "$LIST" in
*/libexec/git-core/git-legacy-stash*)
inno_defines="$(printf "%s\n%s" "$inno_defines" \
"#define WITH_EXPERIMENTAL_BUILTIN_STASH 1")"
;;
esac

GITCONFIG_PATH="$(echo "$LIST" | grep "^mingw$BITNESS/etc/gitconfig\$")"
printf '' >programdata-config.template
test -z "$GITCONFIG_PATH" || {
Expand Down