Skip to content

Commit b9af4e5

Browse files
committed
installer: offer experimental add -i/-p (if available and opt-in)
See git-for-windows/git#2150. This is exciting... Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4a999d3 commit b9af4e5

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

installer/install.iss

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,16 @@ const
352352
#define HAVE_EXPERIMENTAL_OPTIONS 1
353353
#endif
354354
355+
#ifdef WITH_EXPERIMENTAL_BUILTIN_ADD_I
356+
#define HAVE_EXPERIMENTAL_OPTIONS 1
357+
#endif
358+
355359
#ifdef HAVE_EXPERIMENTAL_OPTIONS
356360
// Experimental options
357361
GP_BuiltinDifftool = 1;
358362
GP_BuiltinRebase = 2;
359363
GP_BuiltinStash = 3;
364+
GP_BuiltinAddI = 4;
360365
#endif
361366
362367
var
@@ -416,7 +421,7 @@ var
416421
#ifdef HAVE_EXPERIMENTAL_OPTIONS
417422
// Wizard page and variables for the experimental options.
418423
ExperimentalOptionsPage:TWizardPage;
419-
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_BuiltinStash] of TCheckBox;
424+
RdbExperimentalOptions:array[GP_BuiltinDifftool..GP_BuiltinAddI] of TCheckBox;
420425
#endif
421426
422427
// Mapping controls to hyperlinks
@@ -1861,6 +1866,14 @@ begin
18611866
RdbExperimentalOptions[GP_BuiltinStash].Checked:=ReplayChoice('Enable Builtin Stash','Auto')='Disabled';
18621867
#endif
18631868
1869+
#ifdef WITH_EXPERIMENTAL_BUILTIN_ADD_I
1870+
// 4th option
1871+
RdbExperimentalOptions[GP_BuiltinAddI]:=CreateCheckBox(ExperimentalOptionsPage,'Enable experimental, built-in add -i/-p','<RED>(NEW!)</RED> Use the experimental built-in interactive add ("git add -i" or "git add -p").'+#13+'This makes it faster (especially the startup!), but it is not yet considered robust.',TabOrder,Top,Left);
1872+
1873+
// Restore the settings chosen during a previous install
1874+
RdbExperimentalOptions[GP_BuiltinAddI].Checked:=ReplayChoice('Enable Builtin Interactive Add','Auto')='Disabled';
1875+
#endif
1876+
18641877
#endif
18651878
18661879
(*
@@ -2484,6 +2497,13 @@ begin
24842497
GitSystemConfigSet('stash.useBuiltin',#0);
24852498
#endif
24862499
2500+
#ifdef WITH_EXPERIMENTAL_BUILTIN_ADD_I
2501+
if RdbExperimentalOptions[GP_BuiltinAddI].checked then
2502+
GitSystemConfigSet('add.interactive.useBuiltin','true')
2503+
else
2504+
GitSystemConfigSet('add.interactive.useBuiltin',#0);
2505+
#endif
2506+
24872507
{
24882508
Modify the environment
24892509
@@ -2798,6 +2818,14 @@ begin
27982818
RecordChoice(PreviousDataKey,'Enable Builtin Stash',Data);
27992819
#endif
28002820
2821+
#ifdef WITH_EXPERIMENTAL_BUILTIN_ADD_I
2822+
Data:='Disabled';
2823+
if RdbExperimentalOptions[GP_BuiltinAddI].Checked then begin
2824+
Data:='Enabled';
2825+
end;
2826+
RecordChoice(PreviousDataKey,'Enable Builtin Interactive Add',Data);
2827+
#endif
2828+
28012829
Path:=ExpandConstant('{app}\etc\install-options.txt');
28022830
if not SaveStringToFile(Path,ChosenOptions,False) then
28032831
LogError('Could not write to '+Path);

installer/release.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ case "$LIST" in
149149
;;
150150
esac
151151

152+
if test "$(GIT_CONFIG_NOSYSTEM=1 HOME=. git add --patch=123 2>&1)" != \
153+
"$(git -c add.interactive.usebuiltin=1 add --patch=123 2>&1)"
154+
then
155+
inno_defines="$inno_defines$LF#define WITH_EXPERIMENTAL_BUILTIN_ADD_I 1"
156+
fi
157+
152158
GITCONFIG_PATH="$(echo "$LIST" | grep "^mingw$BITNESS/etc/gitconfig\$")"
153159
printf '' >programdata-config.template
154160
test -z "$GITCONFIG_PATH" || {

0 commit comments

Comments
 (0)