{"thread":{"id":"66119","subject":"[PATCH] add: remove interactive mode","startedAt":"2026-08-05T05:47:22Z","lastAt":"2026-08-05T16:11:03Z","messageCount":3,"participants":["shrimech","Michael Montalbo","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"549638","messageId":"20260805054611.128396-1-eddinen77@gmail.com","threadId":"66119","inReplyTo":null,"subject":"[PATCH] add: remove interactive mode","fromName":"shrimech","fromEmail":"eddinen77@gmail.com","sentAt":"2026-08-05T05:46:11Z","receivedAt":"2026-08-05T05:47:22Z","isPatch":true,"body":"Remove the --interactive (-i) option from git add and drop\nits associated interactive-mode documentation.\n\nThe patch mode (--patch/-p) remains available for interactively\nselecting hunks to stage.\n\nSigned-off-by: shrimech <eddinen77@gmail.com>\n---\n Documentation/git-add.adoc | 140 +++----------------------------------\n builtin/add.c              |  17 ++---\n 2 files changed, 18 insertions(+), 139 deletions(-)\n\ndiff --git a/Documentation/git-add.adoc b/Documentation/git-add.adoc\nindex 941135dc63..89a6bbe309 100644\n--- a/Documentation/git-add.adoc\n+++ b/Documentation/git-add.adoc\n@@ -8,7 +8,7 @@ git-add - Add file contents to the index\n SYNOPSIS\n --------\n [synopsis]\n-git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]\n+git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--patch | -p]\n \t[--edit | -e] [--[no-]all | -A | --[no-]ignore-removal | [--update | -u]] [--sparse]\n \t[--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--renormalize]\n \t[--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]]\n@@ -87,23 +87,12 @@ in linkgit:gitglossary[7].\n \tbe removed from the working tree without warning. See\n \tlinkgit:git-sparse-checkout[1] for more details.\n \n-`-i`::\n-`--interactive`::\n-\tAdd modified contents in the working tree interactively to\n-\tthe index. Optional path arguments may be supplied to limit\n-\toperation to a subset of the working tree. See ``Interactive\n-\tmode'' for details.\n-\n `-p`::\n `--patch`::\n \tInteractively choose hunks of patch between the index and the\n \twork tree and add them to the index. This gives the user a chance\n \tto review the difference before adding modified contents to the\n \tindex.\n-+\n-This effectively runs `add --interactive`, but bypasses the\n-initial command menu and directly jumps to the `patch` subcommand.\n-See ``Interactive mode'' for details.\n \n include::diff-context-options.adoc[]\n \n@@ -171,123 +160,16 @@ for `git add --no-all <pathspec>...`, i.e. ignored removed files.\n \tthem, do not abort the operation, but continue adding the\n \tothers. The command shall still exit with non-zero status.\n \tThe configuration variable `add.ignoreErrors` can be set to\n-\ttrue to make this the default behaviour.\n-\n-`--ignore-missing`::\n-\tThis option can only be used together with `--dry-run`. By using\n-\tthis option the user can check if any of the given files would\n-\tbe ignored, no matter if they are already present in the work\n-\ttree or not.\n-\n-`--no-warn-embedded-repo`::\n-\tBy default, `git add` will warn when adding an embedded\n-\trepository to the index without using `git submodule add` to\n-\tcreate an entry in `.gitmodules`. This option will suppress the\n-\twarning (e.g., if you are manually performing operations on\n-\tsubmodules).\n-\n-`--renormalize`::\n-\tApply the \"clean\" process freshly to all tracked files to\n-\tforcibly add them again to the index.  This is useful after\n-\tchanging `core.autocrlf` configuration or the `text` attribute\n-\tin order to correct files added with wrong _CRLF/LF_ line endings.\n-\tThis option implies `-u`. Lone CR characters are untouched, thus\n-\twhile a _CRLF_ cleans to _LF_, a _CRCRLF_ sequence is only partially\n-\tcleaned to _CRLF_.\n-\n-`--chmod=(+|-)x`::\n-\tOverride the executable bit of the added files.  The executable\n-\tbit is only changed in the index, the files on disk are left\n-\tunchanged.\n-\n-`--pathspec-from-file=<file>`::\n-\tPathspec is passed in _<file>_ instead of commandline args. If\n-\t_<file>_ is exactly `-` then standard input is used. Pathspec\n-\telements are separated by _LF_ or _CR/LF_. Pathspec elements can be\n-\tquoted as explained for the configuration variable `core.quotePath`\n-\t(see linkgit:git-config[1]). See also `--pathspec-file-nul` and\n-\tglobal `--literal-pathspecs`.\n-\n-`--pathspec-file-nul`::\n-\tOnly meaningful with `--pathspec-from-file`. Pathspec elements are\n-\tseparated with _NUL_ character and all other characters are taken\n-\tliterally (including newlines and quotes).\n-\n-`--`::\n-\tThis option can be used to separate command-line options from\n-\tthe list of files, (useful when filenames might be mistaken\n-\tfor command-line options).\n-\n-\n-EXAMPLES\n---------\n-\n-* Adds content from all ++*.txt++ files under `Documentation` directory\n-  and its subdirectories:\n-+\n-------------\n-$ git add Documentation/\\*.txt\n-------------\n-+\n-Note that the asterisk ++*++ is quoted from the shell in this\n-example; this lets the command include the files from\n-subdirectories of `Documentation/` directory.\n-\n-* Considers adding content from all ++git-*.sh++ scripts:\n-+\n-------------\n-$ git add git-*.sh\n-------------\n-+\n-Because this example lets the shell expand the asterisk (i.e. you are\n-listing the files explicitly), it does not consider\n-`subdir/git-foo.sh`.\n-\n-INTERACTIVE MODE\n-----------------\n-When the command enters the interactive mode, it shows the\n-output of the 'status' subcommand, and then goes into its\n-interactive command loop.\n-\n-The command loop shows the list of subcommands available, and\n-gives a prompt \"What now> \".  In general, when the prompt ends\n-with a single '>', you can pick only one of the choices given\n-and type return, like this:\n-\n-------------\n-    *** Commands ***\n-      1: status       2: update       3: revert       4: add untracked\n-      5: patch        6: diff         7: quit         8: help\n-    What now> 1\n-------------\n-\n-You also could say `s` or `sta` or `status` above as long as the\n-choice is unique.\n-\n-The main command loop has 6 subcommands (plus help and quit).\n-\n-status::\n-\n-   This shows the change between `HEAD` and index (i.e. what will be\n-   committed if you say `git commit`), and between index and\n-   working tree files (i.e. what you could stage further before\n-   `git commit` using `git add`) for each path.  A sample output\n-   looks like this:\n-+\n-------------\n-              staged     unstaged path\n-     1:       binary      nothing foo.png\n-     2:     +403/-35        +1/-1 add-interactive.c\n-------------\n-+\n-It shows that `foo.png` has differences from `HEAD` (but that is\n-binary so line count cannot be shown) and there is no\n-difference between indexed copy and the working tree\n-version (if the working tree version were also different,\n-'binary' would have been shown in place of 'nothing').  The\n-other file, `add-interactive.c`, has 403 lines added\n-and 35 lines deleted if you commit what is in the index, but\n-working tree file has further modifications (one addition and\n+\tEDITING PATCHES\n+\t---------------\n+\n+\tInvoking `git add -e` will open a patch in your editor; after the editor exits, the\n+\tresult is applied to the index. You are free to make arbitrary changes\n+\tto the patch, but note that some changes may have confusing results, or\n+\teven result in a patch that cannot be applied.  If you want to abort the\n+\toperation entirely (i.e., stage nothing new in the index), simply delete\n+\tall lines of the patch. The list below describes some common things you\n+\tmay see in a patch, and which editing operations make sense on them.\n one deletion).\n \n update::\ndiff --git a/builtin/add.c b/builtin/add.c\nindex 60ffbede2b..67d33b52a9 100644\n--- a/builtin/add.c\n+++ b/builtin/add.c\n@@ -31,7 +31,7 @@ static const char * const builtin_add_usage[] = {\n \tN_(\"git add [<options>] [--] <pathspec>...\"),\n \tNULL\n };\n-static int patch_interactive, add_interactive, edit_interactive;\n+static int patch_interactive, edit_interactive;\n static struct interactive_options interactive_opts = INTERACTIVE_OPTIONS_INIT;\n static int take_worktree_changes;\n static int add_renormalize;\n@@ -255,7 +255,6 @@ static struct option builtin_add_options[] = {\n \tOPT__DRY_RUN(&show_only, N_(\"dry run\")),\n \tOPT__VERBOSE(&verbose, N_(\"be verbose\")),\n \tOPT_GROUP(\"\"),\n-\tOPT_BOOL('i', \"interactive\", &add_interactive, N_(\"interactive picking\")),\n \tOPT_BOOL('p', \"patch\", &patch_interactive, N_(\"select hunks interactively\")),\n \tOPT_BOOL(0, \"auto-advance\", &interactive_opts.auto_advance,\n \t\t N_(\"auto advance to the next file when selecting hunks interactively\")),\n@@ -408,21 +407,19 @@ int cmd_add(int argc,\n \tif (interactive_opts.interhunkcontext < -1)\n \t\tdie(_(\"'%s' cannot be negative\"), \"--inter-hunk-context\");\n \n-\tif (patch_interactive)\n-\t\tadd_interactive = 1;\n-\tif (add_interactive) {\n+\tif (patch_interactive) {\n \t\tif (show_only)\n-\t\t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--dry-run\", \"--interactive/--patch\");\n+\t\t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--dry-run\", \"--patch\");\n \t\tif (pathspec_from_file)\n-\t\t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--pathspec-from-file\", \"--interactive/--patch\");\n+\t\t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--pathspec-from-file\", \"--patch\");\n \t\texit(interactive_add(repo, argv + 1, prefix, patch_interactive, &interactive_opts));\n \t} else {\n \t\tif (interactive_opts.context != -1)\n-\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--unified\", \"--interactive/--patch\");\n+\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--unified\", \"--patch\");\n \t\tif (interactive_opts.interhunkcontext != -1)\n-\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--inter-hunk-context\", \"--interactive/--patch\");\n+\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--inter-hunk-context\", \"--patch\");\n \t\tif (!interactive_opts.auto_advance)\n-\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--no-auto-advance\", \"--interactive/--patch\");\n+\t\t\tdie(_(\"the option '%s' requires '%s'\"), \"--no-auto-advance\", \"--patch\");\n \t}\n \n \tif (edit_interactive) {\n-- \n2.53.0\n\n"},{"id":"549645","messageId":"CAC2QwmL2HSzJEb5hPbukNdqBzvMd=6ObiDrty+6T9tZ0otmogg@mail.gmail.com","threadId":"66119","inReplyTo":"20260805054611.128396-1-eddinen77@gmail.com","subject":"Re: [PATCH] add: remove interactive mode","fromName":"Michael Montalbo","fromEmail":"mmontalbo@gmail.com","sentAt":"2026-08-05T07:15:34Z","receivedAt":"2026-08-05T07:15:47Z","isPatch":true,"body":"On Tue, Aug 4, 2026 at 10:50 PM shrimech <eddinen77@gmail.com> wrote:\n>\n> Remove the --interactive (-i) option from git add and drop\n> its associated interactive-mode documentation.\n>\n> The patch mode (--patch/-p) remains available for interactively\n> selecting hunks to stage.\n>\n> Signed-off-by: shrimech <eddinen77@gmail.com>\n\nI don't think this commit message is meaningful according to\nDocumentation/SubmittingPatches[1]:\n\n    The body should provide a meaningful commit message, which:\n\n    . explains the problem the change tries to solve, i.e. what is wrong\n      with the current code without the change.\n\n    . justifies the way the change solves the problem, i.e. why the\n      result with the change is better.\n\n    . alternate solutions considered but discarded, if any.\n\n    . records the resolution of design or viability concerns raised by the\n      community during the review, if any, ensuring the historical record\n      explains why the chosen approach was accepted over alternatives.\n\n[1] https://git-scm.com/docs/SubmittingPatches\n"},{"id":"549729","messageId":"xmqqh5l8sg2y.fsf@gitster.g","threadId":"66119","inReplyTo":"CAC2QwmL2HSzJEb5hPbukNdqBzvMd=6ObiDrty+6T9tZ0otmogg@mail.gmail.com","subject":"Re: [PATCH] add: remove interactive mode","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-05T16:11:01Z","receivedAt":"2026-08-05T16:11:03Z","isPatch":true,"body":"Michael Montalbo <mmontalbo@gmail.com> writes:\n\n> On Tue, Aug 4, 2026 at 10:50 PM shrimech <eddinen77@gmail.com> wrote:\n>>\n>> Remove the --interactive (-i) option from git add and drop\n>> its associated interactive-mode documentation.\n>>\n>> The patch mode (--patch/-p) remains available for interactively\n>> selecting hunks to stage.\n>>\n>> Signed-off-by: shrimech <eddinen77@gmail.com>\n>\n> I don't think this commit message is meaningful according to\n> Documentation/SubmittingPatches[1]:\n>\n>     The body should provide a meaningful commit message, which:\n>\n>     . explains the problem the change tries to solve, i.e. what is wrong\n>       with the current code without the change.\n>\n>     . justifies the way the change solves the problem, i.e. why the\n>       result with the change is better.\n>\n>     . alternate solutions considered but discarded, if any.\n>\n>     . records the resolution of design or viability concerns raised by the\n>       community during the review, if any, ensuring the historical record\n>       explains why the chosen approach was accepted over alternatives.\n>\n> [1] https://git-scm.com/docs/SubmittingPatches\n\nMore importantly, a breaking change that will negatively affect\nexisting users' workflows needs to be accompanied by a much better\njustification than a typical opt-in addition.\n\nI could send a patch to remove 'git add' altogether, claiming that\n\"the diff feature remains available so 'git diff' will still work\",\nand yet that is not a sane justification for removing 'git add'.\nJustifying the removal of '-i' based on the availability of '-p' is\njust as bogus as that.\n\nOf course, none of \"I have not heard of this feature\", \"I have not\nused this feature\", \"I no longer use this feature\", and \"I do not\nlike this feature\" is good enough.  \"I have not met anyone who uses\nthis feature\" used to be viable twenty years ago, but not anymore.\n\nThanks.\n"}]}