{"thread":{"id":"41175","subject":"[PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","startedAt":"2016-01-12T15:22:06Z","lastAt":"2016-01-13T21:20:55Z","messageCount":27,"participants":["Johannes Schindelin","Junio C Hamano","Matthieu Moy","Paul Tan"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"275811","messageId":"cover.1452612112.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":null,"subject":"[PATCH 0/3] Support `git pull --rebase=interactive`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-12T15:22:06Z","receivedAt":"2016-01-12T15:22:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A couple of years ago, I found the need to collaborate on topic branches\nthat were rebased all the time, and I really needed to see what I was\nrebasing when pulling, so I introduced an interactively-rebasing pull.\n\nThis patch series ports that work to the builtin pull.\n\n\nJohannes Schindelin (3):\n  Teach 'git pull' to handle --rebase=interactive\n  Teach 'git remote' that the config var branch.*.rebase can be\n    'interactive'\n  completion: add missing branch.*.rebase values\n\n Documentation/config.txt               |  1 +\n Documentation/git-pull.txt             |  4 +++-\n builtin/pull.c                         |  7 ++++++-\n builtin/remote.c                       |  8 ++++++--\n contrib/completion/git-completion.bash |  2 +-\n t/t5520-pull.sh                        | 10 ++++++++++\n 6 files changed, 27 insertions(+), 5 deletions(-)\n\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275809","messageId":"5ed91705cc70323dd3f175627acf86a4f594536c.1452612112.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452612112.git.johannes.schindelin@gmx.de","subject":"[PATCH 1/3] Teach 'git pull' to handle --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-12T15:22:11Z","receivedAt":"2016-01-12T15:22:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The way builtin pull works, this incidentally also supports the value\n'interactive' for the 'branch.<name>.rebase' config variable.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/config.txt   |  1 +\n Documentation/git-pull.txt |  4 +++-\n builtin/pull.c             |  7 ++++++-\n t/t5520-pull.sh            | 10 ++++++++++\n 4 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex beb18da..647b5f0 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -865,6 +865,7 @@ branch.<name>.rebase::\n \tinstead of merging the default branch from the default remote when\n \t\"git pull\" is run. See \"pull.rebase\" for doing this in a non\n \tbranch-specific manner.\n+\tWhen the value is `interactive`, the rebase is run in interactive mode.\n +\n When preserve, also pass `--preserve-merges` along to 'git rebase'\n so that locally committed merge commits will not be flattened\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 93c72a2..a62a2a6 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -101,7 +101,7 @@ Options related to merging\n include::merge-options.txt[]\n \n -r::\n---rebase[=false|true|preserve]::\n+--rebase[=false|true|preserve|interactive]::\n \tWhen true, rebase the current branch on top of the upstream\n \tbranch after fetching. If there is a remote-tracking branch\n \tcorresponding to the upstream branch and the upstream branch\n@@ -113,6 +113,8 @@ to `git rebase` so that locally created merge commits will not be flattened.\n +\n When false, merge the current branch into the upstream branch.\n +\n+When `interactive`, enable the interactive mode of rebase.\n++\n See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in\n linkgit:git-config[1] if you want to make `git pull` always use\n `--rebase` instead of merging.\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 9e3c738..832d0ad 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -22,7 +22,8 @@ enum rebase_type {\n \tREBASE_INVALID = -1,\n \tREBASE_FALSE = 0,\n \tREBASE_TRUE,\n-\tREBASE_PRESERVE\n+\tREBASE_PRESERVE,\n+\tREBASE_INTERACTIVE\n };\n \n /**\n@@ -42,6 +43,8 @@ static enum rebase_type parse_config_rebase(const char *key, const char *value,\n \t\treturn REBASE_TRUE;\n \telse if (!strcmp(value, \"preserve\"))\n \t\treturn REBASE_PRESERVE;\n+\telse if (!strcmp(value, \"interactive\"))\n+\t\treturn REBASE_INTERACTIVE;\n \n \tif (fatal)\n \t\tdie(_(\"Invalid value for %s: %s\"), key, value);\n@@ -778,6 +781,8 @@ static int run_rebase(const unsigned char *curr_head,\n \t/* Options passed to git-rebase */\n \tif (opt_rebase == REBASE_PRESERVE)\n \t\targv_array_push(&args, \"--preserve-merges\");\n+\telse if (opt_rebase == REBASE_INTERACTIVE)\n+\t\targv_array_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\targv_array_push(&args, opt_diffstat);\n \targv_array_pushv(&args, opt_strategies.argv);\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex a0013ee..c952d5e 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -326,6 +326,16 @@ test_expect_success 'pull.rebase=preserve rebases and merges keep-merge' '\n \ttest \"$(git rev-parse HEAD^2)\" = \"$(git rev-parse keep-merge)\"\n '\n \n+test_expect_success 'pull.rebase=interactive' '\n+\twrite_script \"$TRASH_DIRECTORY/fake-editor\" <<-\\EOF &&\n+\techo I was here >fake.out &&\n+\tfalse\n+\tEOF\n+\ttest_set_editor \"$TRASH_DIRECTORY/fake-editor\" &&\n+\ttest_must_fail git pull --rebase=interactive . copy &&\n+\ttest \"I was here\" = \"$(cat fake.out)\"\n+'\n+\n test_expect_success 'pull.rebase=invalid fails' '\n \tgit reset --hard before-preserve-rebase &&\n \ttest_config pull.rebase invalid &&\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275808","messageId":"8c98523f8a3f2c6f2f3db1e4572e05c28f94688d.1452612112.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452612112.git.johannes.schindelin@gmx.de","subject":"[PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-12T15:22:16Z","receivedAt":"2016-01-12T15:22:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin/remote.c | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 6694cf2..0af8300 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n struct branch_info {\n \tchar *remote_name;\n \tstruct string_list merge;\n-\tint rebase;\n+\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n };\n \n static struct string_list branch_list;\n@@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\t\t\tinfo->rebase = v;\n \t\t\telse if (!strcmp(value, \"preserve\"))\n \t\t\t\tinfo->rebase = 1;\n+\t\t\telse if (!strcmp(value, \"interactive\"))\n+\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n \t\t}\n \t}\n \treturn 0;\n@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \n \tprintf(\"    %-*s \", show_info->width, item->string);\n \tif (branch_info->rebase) {\n-\t\tprintf_ln(_(\"rebases onto remote %s\"), merge->items[0].string);\n+\t\tprintf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?\n+\t\t\t\"rebases interactively onto remote %s\" :\n+\t\t\t\"rebases onto remote %s\"), merge->items[0].string);\n \t\treturn 0;\n \t} else if (show_info->any_rebase) {\n \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275810","messageId":"cf10b421435e456c0dce15e547bb748081919b08.1452612112.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452612112.git.johannes.schindelin@gmx.de","subject":"[PATCH 3/3] completion: add missing branch.*.rebase values","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-12T15:22:21Z","receivedAt":"2016-01-12T15:22:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex ab4da7f..51f5223 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1809,7 +1809,7 @@ _git_config ()\n \t\treturn\n \t\t;;\n \tbranch.*.rebase)\n-\t\t__gitcomp \"false true\"\n+\t\t__gitcomp \"false true preserve interactive\"\n \t\treturn\n \t\t;;\n \tremote.pushdefault)\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275843","messageId":"xmqqsi22s6x7.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"5ed91705cc70323dd3f175627acf86a4f594536c.1452612112.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 1/3] Teach 'git pull' to handle --rebase=interactive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-12T23:40:36Z","receivedAt":"2016-01-12T23:40:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Subject: Re: [PATCH 1/3] Teach 'git pull' to handle --rebase=interactive\n\nSubject: pull: allow interactive rebase with --rebase=interactive\n\nor something?  The same comment applies for the other patches in\nthis series, and other recent patches from you in general.\n\n> The way builtin pull works, this incidentally also supports the value\n> 'interactive' for the 'branch.<name>.rebase' config variable.\n\nThat, especially the \"incidentally\" part, makes it sound as if it is\n\"because we can easily\", not \"because it is useful in such and such\nway, we must support it\".  We definitely want to see patches that\nfall into the latter category, and from the sound of 0/3, I think\nthis one should be advertised as such.\n\nThe patch text looks good (admittedly from only a cursory read,\nthough).\n\nThanks.\n"},{"id":"275845","messageId":"xmqqk2nes6cc.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"8c98523f8a3f2c6f2f3db1e4572e05c28f94688d.1452612112.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-12T23:53:07Z","receivedAt":"2016-01-12T23:53:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  builtin/remote.c | 8 ++++++--\n>  1 file changed, 6 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/remote.c b/builtin/remote.c\n> index 6694cf2..0af8300 100644\n> --- a/builtin/remote.c\n> +++ b/builtin/remote.c\n> @@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n>  struct branch_info {\n>  \tchar *remote_name;\n>  \tstruct string_list merge;\n> -\tint rebase;\n> +\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n>  };\n>  \n>  static struct string_list branch_list;\n> @@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n>  \t\t\t\tinfo->rebase = v;\n>  \t\t\telse if (!strcmp(value, \"preserve\"))\n>  \t\t\t\tinfo->rebase = 1;\n\nThis should become NORMAL_REBASE, I would think, even though the\nresulting machine code should be identical.\n\n> +\t\t\telse if (!strcmp(value, \"interactive\"))\n> +\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n>  \t\t}\n>  \t}\n>  \treturn 0;\n> @@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n>  \n>  \tprintf(\"    %-*s \", show_info->width, item->string);\n>  \tif (branch_info->rebase) {\n> -\t\tprintf_ln(_(\"rebases onto remote %s\"), merge->items[0].string);\n> +\t\tprintf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?\n> +\t\t\t\"rebases interactively onto remote %s\" :\n> +\t\t\t\"rebases onto remote %s\"), merge->items[0].string);\n>  \t\treturn 0;\n>  \t} else if (show_info->any_rebase) {\n>  \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n"},{"id":"275846","messageId":"xmqqfuy2s69o.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"cf10b421435e456c0dce15e547bb748081919b08.1452612112.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 3/3] completion: add missing branch.*.rebase values","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-12T23:54:43Z","receivedAt":"2016-01-12T23:54:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  contrib/completion/git-completion.bash | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index ab4da7f..51f5223 100644\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1809,7 +1809,7 @@ _git_config ()\n>  \t\treturn\n>  \t\t;;\n>  \tbranch.*.rebase)\n> -\t\t__gitcomp \"false true\"\n> +\t\t__gitcomp \"false true preserve interactive\"\n>  \t\treturn\n>  \t\t;;\n>  \tremote.pushdefault)\n\nOK, thanks.\n"},{"id":"275871","messageId":"alpine.DEB.2.20.1601130751130.2964@virtualbox","threadId":"41175","inReplyTo":"xmqqk2nes6cc.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:51:33Z","receivedAt":"2016-01-13T06:51:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 12 Jan 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  builtin/remote.c | 8 ++++++--\n> >  1 file changed, 6 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/builtin/remote.c b/builtin/remote.c\n> > index 6694cf2..0af8300 100644\n> > --- a/builtin/remote.c\n> > +++ b/builtin/remote.c\n> > @@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n> >  struct branch_info {\n> >  \tchar *remote_name;\n> >  \tstruct string_list merge;\n> > -\tint rebase;\n> > +\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n> >  };\n> >  \n> >  static struct string_list branch_list;\n> > @@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n> >  \t\t\t\tinfo->rebase = v;\n> >  \t\t\telse if (!strcmp(value, \"preserve\"))\n> >  \t\t\t\tinfo->rebase = 1;\n> \n> This should become NORMAL_REBASE, I would think, even though the\n> resulting machine code should be identical.\n\nFixed in v2.\n\nThanks,\nDscho\n"},{"id":"275873","messageId":"alpine.DEB.2.20.1601130751560.2964@virtualbox","threadId":"41175","inReplyTo":"xmqqsi22s6x7.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 1/3] Teach 'git pull' to handle --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:52:27Z","receivedAt":"2016-01-13T06:52:27Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Tue, 12 Jan 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > Subject: Re: [PATCH 1/3] Teach 'git pull' to handle --rebase=interactive\n> \n> Subject: pull: allow interactive rebase with --rebase=interactive\n> \n> or something?  The same comment applies for the other patches in\n> this series, and other recent patches from you in general.\n\nFixed in v2.\n\n> > The way builtin pull works, this incidentally also supports the value\n> > 'interactive' for the 'branch.<name>.rebase' config variable.\n> \n> That, especially the \"incidentally\" part, makes it sound as if it is\n> \"because we can easily\", not \"because it is useful in such and such\n> way, we must support it\".  We definitely want to see patches that\n> fall into the latter category, and from the sound of 0/3, I think\n> this one should be advertised as such.\n\nAlso addressed in v2.\n\nThanks,\nDscho\n"},{"id":"275875","messageId":"cover.1452668201.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452612112.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 0/3] Support `git pull --rebase=interactive`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:57:44Z","receivedAt":"2016-01-13T06:57:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A couple of years ago, I found the need to collaborate on topic branches\nthat were rebased all the time, and I really needed to see what I was\nrebasing when pulling, so I introduced an interactively-rebasing pull.\n\nThis patch series ports that work to the builtin pull.\n\nApart from the change outlined in the interdiff, the first two commit\nmessages changed, too.\n\nJohannes Schindelin (3):\n  pull: allow interactive rebase with --rebase=interactive\n  remote: handle the config setting branch.*.rebase=interactive\n  completion: add missing branch.*.rebase values\n\n Documentation/config.txt               |  1 +\n Documentation/git-pull.txt             |  4 +++-\n builtin/pull.c                         |  7 ++++++-\n builtin/remote.c                       | 10 +++++++---\n contrib/completion/git-completion.bash |  2 +-\n t/t5520-pull.sh                        | 10 ++++++++++\n 6 files changed, 28 insertions(+), 6 deletions(-)\n\nInterdiff vs v1:\n\n diff --git a/builtin/remote.c b/builtin/remote.c\n index 0af8300..2b2ff9b 100644\n --- a/builtin/remote.c\n +++ b/builtin/remote.c\n @@ -311,7 +311,7 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n  \t\t\tif (v >= 0)\n  \t\t\t\tinfo->rebase = v;\n  \t\t\telse if (!strcmp(value, \"preserve\"))\n -\t\t\t\tinfo->rebase = 1;\n +\t\t\t\tinfo->rebase = NORMAL_REBASE;\n  \t\t\telse if (!strcmp(value, \"interactive\"))\n  \t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n  \t\t}\n\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275874","messageId":"2ebf99214ba600b63a39c58bcb9abb7941a7619d.1452668201.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452668201.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:57:50Z","receivedAt":"2016-01-13T06:57:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The way builtin pull works, this change also supports the value\n'interactive' for the 'branch.<name>.rebase' config variable, which\nis a neat thing because users can now configure given branches for\ninteractively-rebasing pulls without having to type out the complete\n`--rebase=interactive` option every time they pull.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/config.txt   |  1 +\n Documentation/git-pull.txt |  4 +++-\n builtin/pull.c             |  7 ++++++-\n t/t5520-pull.sh            | 10 ++++++++++\n 4 files changed, 20 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 07f7a3b..e5897e9 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -865,6 +865,7 @@ branch.<name>.rebase::\n \tinstead of merging the default branch from the default remote when\n \t\"git pull\" is run. See \"pull.rebase\" for doing this in a non\n \tbranch-specific manner.\n+\tWhen the value is `interactive`, the rebase is run in interactive mode.\n +\n When preserve, also pass `--preserve-merges` along to 'git rebase'\n so that locally committed merge commits will not be flattened\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 93c72a2..a62a2a6 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -101,7 +101,7 @@ Options related to merging\n include::merge-options.txt[]\n \n -r::\n---rebase[=false|true|preserve]::\n+--rebase[=false|true|preserve|interactive]::\n \tWhen true, rebase the current branch on top of the upstream\n \tbranch after fetching. If there is a remote-tracking branch\n \tcorresponding to the upstream branch and the upstream branch\n@@ -113,6 +113,8 @@ to `git rebase` so that locally created merge commits will not be flattened.\n +\n When false, merge the current branch into the upstream branch.\n +\n+When `interactive`, enable the interactive mode of rebase.\n++\n See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in\n linkgit:git-config[1] if you want to make `git pull` always use\n `--rebase` instead of merging.\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 9e3c738..832d0ad 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -22,7 +22,8 @@ enum rebase_type {\n \tREBASE_INVALID = -1,\n \tREBASE_FALSE = 0,\n \tREBASE_TRUE,\n-\tREBASE_PRESERVE\n+\tREBASE_PRESERVE,\n+\tREBASE_INTERACTIVE\n };\n \n /**\n@@ -42,6 +43,8 @@ static enum rebase_type parse_config_rebase(const char *key, const char *value,\n \t\treturn REBASE_TRUE;\n \telse if (!strcmp(value, \"preserve\"))\n \t\treturn REBASE_PRESERVE;\n+\telse if (!strcmp(value, \"interactive\"))\n+\t\treturn REBASE_INTERACTIVE;\n \n \tif (fatal)\n \t\tdie(_(\"Invalid value for %s: %s\"), key, value);\n@@ -778,6 +781,8 @@ static int run_rebase(const unsigned char *curr_head,\n \t/* Options passed to git-rebase */\n \tif (opt_rebase == REBASE_PRESERVE)\n \t\targv_array_push(&args, \"--preserve-merges\");\n+\telse if (opt_rebase == REBASE_INTERACTIVE)\n+\t\targv_array_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\targv_array_push(&args, opt_diffstat);\n \targv_array_pushv(&args, opt_strategies.argv);\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex a0013ee..c952d5e 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -326,6 +326,16 @@ test_expect_success 'pull.rebase=preserve rebases and merges keep-merge' '\n \ttest \"$(git rev-parse HEAD^2)\" = \"$(git rev-parse keep-merge)\"\n '\n \n+test_expect_success 'pull.rebase=interactive' '\n+\twrite_script \"$TRASH_DIRECTORY/fake-editor\" <<-\\EOF &&\n+\techo I was here >fake.out &&\n+\tfalse\n+\tEOF\n+\ttest_set_editor \"$TRASH_DIRECTORY/fake-editor\" &&\n+\ttest_must_fail git pull --rebase=interactive . copy &&\n+\ttest \"I was here\" = \"$(cat fake.out)\"\n+'\n+\n test_expect_success 'pull.rebase=invalid fails' '\n \tgit reset --hard before-preserve-rebase &&\n \ttest_config pull.rebase invalid &&\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275876","messageId":"dc6d942106bdaf373fe232313523ed36567601b1.1452668201.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452668201.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 2/3] remote: handle the config setting branch.*.rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:57:55Z","receivedAt":"2016-01-13T06:57:55Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The config variable branch.<branchname>.rebase is not only used by `git\npull`, but also by `git remote` when showing details about a remote.\nTherefore, it needs to be taught to accept the newly-introduced\n`interactive` value of said variable.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin/remote.c | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 6694cf2..2b2ff9b 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n struct branch_info {\n \tchar *remote_name;\n \tstruct string_list merge;\n-\tint rebase;\n+\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n };\n \n static struct string_list branch_list;\n@@ -311,7 +311,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\t\tif (v >= 0)\n \t\t\t\tinfo->rebase = v;\n \t\t\telse if (!strcmp(value, \"preserve\"))\n-\t\t\t\tinfo->rebase = 1;\n+\t\t\t\tinfo->rebase = NORMAL_REBASE;\n+\t\t\telse if (!strcmp(value, \"interactive\"))\n+\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n \t\t}\n \t}\n \treturn 0;\n@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \n \tprintf(\"    %-*s \", show_info->width, item->string);\n \tif (branch_info->rebase) {\n-\t\tprintf_ln(_(\"rebases onto remote %s\"), merge->items[0].string);\n+\t\tprintf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?\n+\t\t\t\"rebases interactively onto remote %s\" :\n+\t\t\t\"rebases onto remote %s\"), merge->items[0].string);\n \t\treturn 0;\n \t} else if (show_info->any_rebase) {\n \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275877","messageId":"e2c52057ff9276b4e1e868af0ba209cc4e313867.1452668201.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452668201.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 3/3] completion: add missing branch.*.rebase values","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T06:57:59Z","receivedAt":"2016-01-13T06:57:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex ab4da7f..51f5223 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1809,7 +1809,7 @@ _git_config ()\n \t\treturn\n \t\t;;\n \tbranch.*.rebase)\n-\t\t__gitcomp \"false true\"\n+\t\t__gitcomp \"false true preserve interactive\"\n \t\treturn\n \t\t;;\n \tremote.pushdefault)\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275886","messageId":"vpq7fjdyfvu.fsf@anie.imag.fr","threadId":"41175","inReplyTo":"8c98523f8a3f2c6f2f3db1e4572e05c28f94688d.1452612112.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-01-13T09:42:45Z","receivedAt":"2016-01-13T09:42:45Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  builtin/remote.c | 8 ++++++--\n>  1 file changed, 6 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/remote.c b/builtin/remote.c\n> index 6694cf2..0af8300 100644\n> --- a/builtin/remote.c\n> +++ b/builtin/remote.c\n> @@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n>  struct branch_info {\n>  \tchar *remote_name;\n>  \tstruct string_list merge;\n> -\tint rebase;\n> +\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n>  };\n>  \n>  static struct string_list branch_list;\n> @@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n>  \t\t\t\tinfo->rebase = v;\n>  \t\t\telse if (!strcmp(value, \"preserve\"))\n>  \t\t\t\tinfo->rebase = 1;\n> +\t\t\telse if (!strcmp(value, \"interactive\"))\n> +\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n\nWhat happens if one has branch.*.rebase=interactive, and wants to make\nan exception? Does\n\n  git pull --rebase=true\n\ncancel the 'interactive' part? I guess it is, but if so I think it\nshould be tested and documented.\n\nAnyway, thanks for the patch.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"275887","messageId":"CACRoPnS_CcAuu_jBo9zcjycSN4kvSQhCONNYnY1XRnarRF9Zmw@mail.gmail.com","threadId":"41175","inReplyTo":"2ebf99214ba600b63a39c58bcb9abb7941a7619d.1452668201.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2016-01-13T10:33:10Z","receivedAt":"2016-01-13T10:33:10Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"Hi Dscho,\n\nOn Wed, Jan 13, 2016 at 2:57 PM, Johannes Schindelin\n<johannes.schindelin@gmx.de> wrote:\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 07f7a3b..e5897e9 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -865,6 +865,7 @@ branch.<name>.rebase::\n>         instead of merging the default branch from the default remote when\n>         \"git pull\" is run. See \"pull.rebase\" for doing this in a non\n>         branch-specific manner.\n> +       When the value is `interactive`, the rebase is run in interactive mode.\n>  +\n>  When preserve, also pass `--preserve-merges` along to 'git rebase'\n>  so that locally committed merge commits will not be flattened\n\nI think this change needs to be repeated for the section on\n\"pull.rebase\" as well.\n\n> [...]\n> --\n> 2.6.3.windows.1.300.g1c25e49\n\nOther than that, builtin/pull.c has the following option definition\nthat needs to be updated:\n\n{ OPTION_CALLBACK, 'r', \"rebase\", &opt_rebase, \"false|true|preserve\",\nN_(\"incorporate changes by rebasing rather than merging\"),\n\nThe \"false|true|preserve\" needs to be updated to\n\"false|true|preserve|interactive\", I think.\n\nRegards,\nPaul\n"},{"id":"275891","messageId":"alpine.DEB.2.20.1601131302340.2964@virtualbox","threadId":"41175","inReplyTo":"vpq7fjdyfvu.fsf@anie.imag.fr","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:03:57Z","receivedAt":"2016-01-13T12:03:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Matthieu,\n\nOn Wed, 13 Jan 2016, Matthieu Moy wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > diff --git a/builtin/remote.c b/builtin/remote.c\n> > index 6694cf2..0af8300 100644\n> > --- a/builtin/remote.c\n> > +++ b/builtin/remote.c\n> >  static struct string_list branch_list;\n> > @@ -312,6 +312,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n> >  \t\t\t\tinfo->rebase = v;\n> >  \t\t\telse if (!strcmp(value, \"preserve\"))\n> >  \t\t\t\tinfo->rebase = 1;\n> > +\t\t\telse if (!strcmp(value, \"interactive\"))\n> > +\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n> \n> What happens if one has branch.*.rebase=interactive, and wants to make\n> an exception? Does\n> \n>   git pull --rebase=true\n> \n> cancel the 'interactive' part?\n\nIt is the same situation as before (just substitute a\nbranch.*.rebase=preserve setting): yes, the config is parsed first, then\nthe command line, so the command line wins.\n\n> I guess it is, but if so I think it should be tested and documented.\n\nIs this really necessary, given that the behavior has not changed from\nbefore?\n\nCiao,\nDscho\n"},{"id":"275892","messageId":"alpine.DEB.2.20.1601131313270.2964@virtualbox","threadId":"41175","inReplyTo":"CACRoPnS_CcAuu_jBo9zcjycSN4kvSQhCONNYnY1XRnarRF9Zmw@mail.gmail.com","subject":"Re: [PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:13:57Z","receivedAt":"2016-01-13T12:13:57Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Paul,\n\nOn Wed, 13 Jan 2016, Paul Tan wrote:\n\n> On Wed, Jan 13, 2016 at 2:57 PM, Johannes Schindelin\n> <johannes.schindelin@gmx.de> wrote:\n> > diff --git a/Documentation/config.txt b/Documentation/config.txt\n> > index 07f7a3b..e5897e9 100644\n> > --- a/Documentation/config.txt\n> > +++ b/Documentation/config.txt\n> > @@ -865,6 +865,7 @@ branch.<name>.rebase::\n> >         instead of merging the default branch from the default remote when\n> >         \"git pull\" is run. See \"pull.rebase\" for doing this in a non\n> >         branch-specific manner.\n> > +       When the value is `interactive`, the rebase is run in interactive mode.\n> >  +\n> >  When preserve, also pass `--preserve-merges` along to 'git rebase'\n> >  so that locally committed merge commits will not be flattened\n> \n> I think this change needs to be repeated for the section on\n> \"pull.rebase\" as well.\n> \n> > [...]\n> > --\n> > 2.6.3.windows.1.300.g1c25e49\n> \n> Other than that, builtin/pull.c has the following option definition\n> that needs to be updated:\n> \n> { OPTION_CALLBACK, 'r', \"rebase\", &opt_rebase, \"false|true|preserve\",\n> N_(\"incorporate changes by rebasing rather than merging\"),\n> \n> The \"false|true|preserve\" needs to be updated to\n> \"false|true|preserve|interactive\", I think.\n\nGood points, both. Fixed in the upcoming v3.\n\nCiao,\nDscho\n"},{"id":"275893","messageId":"cover.1452687410.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452668201.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 0/3] Support `git pull --rebase=interactive`","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:17:10Z","receivedAt":"2016-01-13T12:17:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"A couple of years ago, I found the need to collaborate on topic branches\nthat were rebased all the time, and I really needed to see what I was\nrebasing when pulling, so I introduced an interactively-rebasing pull.\n\nThis patch series ports that work to the builtin pull.\n\n\nJohannes Schindelin (3):\n  pull: allow interactive rebase with --rebase=interactive\n  remote: handle the config setting branch.*.rebase=interactive\n  completion: add missing branch.*.rebase values\n\n Documentation/config.txt               |  4 ++++\n Documentation/git-pull.txt             |  4 +++-\n builtin/pull.c                         |  9 +++++++--\n builtin/remote.c                       | 10 +++++++---\n contrib/completion/git-completion.bash |  2 +-\n t/t5520-pull.sh                        | 10 ++++++++++\n 6 files changed, 32 insertions(+), 7 deletions(-)\n\nInterdiff vs v2:\n\n diff --git a/Documentation/config.txt b/Documentation/config.txt\n index e5897e9..0f710ca 100644\n --- a/Documentation/config.txt\n +++ b/Documentation/config.txt\n @@ -865,12 +865,13 @@ branch.<name>.rebase::\n  \tinstead of merging the default branch from the default remote when\n  \t\"git pull\" is run. See \"pull.rebase\" for doing this in a non\n  \tbranch-specific manner.\n -\tWhen the value is `interactive`, the rebase is run in interactive mode.\n  +\n  When preserve, also pass `--preserve-merges` along to 'git rebase'\n  so that locally committed merge commits will not be flattened\n  by running 'git pull'.\n  +\n +When the value is `interactive`, the rebase is run in interactive mode.\n ++\n  *NOTE*: this is a possibly dangerous operation; do *not* use\n  it unless you understand the implications (see linkgit:git-rebase[1]\n  for details).\n @@ -2158,6 +2159,8 @@ When preserve, also pass `--preserve-merges` along to 'git rebase'\n  so that locally committed merge commits will not be flattened\n  by running 'git pull'.\n  +\n +When the value is `interactive`, the rebase is run in interactive mode.\n ++\n  *NOTE*: this is a possibly dangerous operation; do *not* use\n  it unless you understand the implications (see linkgit:git-rebase[1]\n  for details).\n diff --git a/builtin/pull.c b/builtin/pull.c\n index 832d0ad..c713fe0 100644\n --- a/builtin/pull.c\n +++ b/builtin/pull.c\n @@ -116,7 +116,7 @@ static struct option pull_options[] = {\n  \t/* Options passed to git-merge or git-rebase */\n  \tOPT_GROUP(N_(\"Options related to merging\")),\n  \t{ OPTION_CALLBACK, 'r', \"rebase\", &opt_rebase,\n -\t  \"false|true|preserve\",\n +\t  \"false|true|preserve|interactive\",\n  \t  N_(\"incorporate changes by rebasing rather than merging\"),\n  \t  PARSE_OPT_OPTARG, parse_opt_rebase },\n  \tOPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,\n\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275896","messageId":"a8e173aeb747369f554eeede1955060deadd3550.1452687410.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452687410.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:17:15Z","receivedAt":"2016-01-13T12:17:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The way builtin pull works, this change also supports the value\n'interactive' for the 'branch.<name>.rebase' config variable, which\nis a neat thing because users can now configure given branches for\ninteractively-rebasing pulls without having to type out the complete\n`--rebase=interactive` option every time they pull.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/config.txt   |  4 ++++\n Documentation/git-pull.txt |  4 +++-\n builtin/pull.c             |  9 +++++++--\n t/t5520-pull.sh            | 10 ++++++++++\n 4 files changed, 24 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 07f7a3b..0f710ca 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -870,6 +870,8 @@ When preserve, also pass `--preserve-merges` along to 'git rebase'\n so that locally committed merge commits will not be flattened\n by running 'git pull'.\n +\n+When the value is `interactive`, the rebase is run in interactive mode.\n++\n *NOTE*: this is a possibly dangerous operation; do *not* use\n it unless you understand the implications (see linkgit:git-rebase[1]\n for details).\n@@ -2157,6 +2159,8 @@ When preserve, also pass `--preserve-merges` along to 'git rebase'\n so that locally committed merge commits will not be flattened\n by running 'git pull'.\n +\n+When the value is `interactive`, the rebase is run in interactive mode.\n++\n *NOTE*: this is a possibly dangerous operation; do *not* use\n it unless you understand the implications (see linkgit:git-rebase[1]\n for details).\ndiff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt\nindex 93c72a2..a62a2a6 100644\n--- a/Documentation/git-pull.txt\n+++ b/Documentation/git-pull.txt\n@@ -101,7 +101,7 @@ Options related to merging\n include::merge-options.txt[]\n \n -r::\n---rebase[=false|true|preserve]::\n+--rebase[=false|true|preserve|interactive]::\n \tWhen true, rebase the current branch on top of the upstream\n \tbranch after fetching. If there is a remote-tracking branch\n \tcorresponding to the upstream branch and the upstream branch\n@@ -113,6 +113,8 @@ to `git rebase` so that locally created merge commits will not be flattened.\n +\n When false, merge the current branch into the upstream branch.\n +\n+When `interactive`, enable the interactive mode of rebase.\n++\n See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in\n linkgit:git-config[1] if you want to make `git pull` always use\n `--rebase` instead of merging.\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 9e3c738..c713fe0 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -22,7 +22,8 @@ enum rebase_type {\n \tREBASE_INVALID = -1,\n \tREBASE_FALSE = 0,\n \tREBASE_TRUE,\n-\tREBASE_PRESERVE\n+\tREBASE_PRESERVE,\n+\tREBASE_INTERACTIVE\n };\n \n /**\n@@ -42,6 +43,8 @@ static enum rebase_type parse_config_rebase(const char *key, const char *value,\n \t\treturn REBASE_TRUE;\n \telse if (!strcmp(value, \"preserve\"))\n \t\treturn REBASE_PRESERVE;\n+\telse if (!strcmp(value, \"interactive\"))\n+\t\treturn REBASE_INTERACTIVE;\n \n \tif (fatal)\n \t\tdie(_(\"Invalid value for %s: %s\"), key, value);\n@@ -113,7 +116,7 @@ static struct option pull_options[] = {\n \t/* Options passed to git-merge or git-rebase */\n \tOPT_GROUP(N_(\"Options related to merging\")),\n \t{ OPTION_CALLBACK, 'r', \"rebase\", &opt_rebase,\n-\t  \"false|true|preserve\",\n+\t  \"false|true|preserve|interactive\",\n \t  N_(\"incorporate changes by rebasing rather than merging\"),\n \t  PARSE_OPT_OPTARG, parse_opt_rebase },\n \tOPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,\n@@ -778,6 +781,8 @@ static int run_rebase(const unsigned char *curr_head,\n \t/* Options passed to git-rebase */\n \tif (opt_rebase == REBASE_PRESERVE)\n \t\targv_array_push(&args, \"--preserve-merges\");\n+\telse if (opt_rebase == REBASE_INTERACTIVE)\n+\t\targv_array_push(&args, \"--interactive\");\n \tif (opt_diffstat)\n \t\targv_array_push(&args, opt_diffstat);\n \targv_array_pushv(&args, opt_strategies.argv);\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex a0013ee..c952d5e 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -326,6 +326,16 @@ test_expect_success 'pull.rebase=preserve rebases and merges keep-merge' '\n \ttest \"$(git rev-parse HEAD^2)\" = \"$(git rev-parse keep-merge)\"\n '\n \n+test_expect_success 'pull.rebase=interactive' '\n+\twrite_script \"$TRASH_DIRECTORY/fake-editor\" <<-\\EOF &&\n+\techo I was here >fake.out &&\n+\tfalse\n+\tEOF\n+\ttest_set_editor \"$TRASH_DIRECTORY/fake-editor\" &&\n+\ttest_must_fail git pull --rebase=interactive . copy &&\n+\ttest \"I was here\" = \"$(cat fake.out)\"\n+'\n+\n test_expect_success 'pull.rebase=invalid fails' '\n \tgit reset --hard before-preserve-rebase &&\n \ttest_config pull.rebase invalid &&\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275895","messageId":"4e9ef3bba31f6d1d2327684c859a10678af9b1b5.1452687410.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452687410.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 2/3] remote: handle the config setting branch.*.rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:17:19Z","receivedAt":"2016-01-13T12:17:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The config variable branch.<branchname>.rebase is not only used by `git\npull`, but also by `git remote` when showing details about a remote.\nTherefore, it needs to be taught to accept the newly-introduced\n`interactive` value of said variable.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n builtin/remote.c | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/remote.c b/builtin/remote.c\nindex 6694cf2..2b2ff9b 100644\n--- a/builtin/remote.c\n+++ b/builtin/remote.c\n@@ -251,7 +251,7 @@ static int add(int argc, const char **argv)\n struct branch_info {\n \tchar *remote_name;\n \tstruct string_list merge;\n-\tint rebase;\n+\tenum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;\n };\n \n static struct string_list branch_list;\n@@ -311,7 +311,9 @@ static int config_read_branches(const char *key, const char *value, void *cb)\n \t\t\tif (v >= 0)\n \t\t\t\tinfo->rebase = v;\n \t\t\telse if (!strcmp(value, \"preserve\"))\n-\t\t\t\tinfo->rebase = 1;\n+\t\t\t\tinfo->rebase = NORMAL_REBASE;\n+\t\t\telse if (!strcmp(value, \"interactive\"))\n+\t\t\t\tinfo->rebase = INTERACTIVE_REBASE;\n \t\t}\n \t}\n \treturn 0;\n@@ -980,7 +982,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)\n \n \tprintf(\"    %-*s \", show_info->width, item->string);\n \tif (branch_info->rebase) {\n-\t\tprintf_ln(_(\"rebases onto remote %s\"), merge->items[0].string);\n+\t\tprintf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?\n+\t\t\t\"rebases interactively onto remote %s\" :\n+\t\t\t\"rebases onto remote %s\"), merge->items[0].string);\n \t\treturn 0;\n \t} else if (show_info->any_rebase) {\n \t\tprintf_ln(_(\" merges with remote %s\"), merge->items[0].string);\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275894","messageId":"409097954d16f7a3d8d16a985d6fac06eb050499.1452687410.git.johannes.schindelin@gmx.de","threadId":"41175","inReplyTo":"cover.1452687410.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 3/3] completion: add missing branch.*.rebase values","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T12:17:22Z","receivedAt":"2016-01-13T12:17:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/completion/git-completion.bash | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex ab4da7f..51f5223 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1809,7 +1809,7 @@ _git_config ()\n \t\treturn\n \t\t;;\n \tbranch.*.rebase)\n-\t\t__gitcomp \"false true\"\n+\t\t__gitcomp \"false true preserve interactive\"\n \t\treturn\n \t\t;;\n \tremote.pushdefault)\n-- \n2.6.3.windows.1.300.g1c25e49\n"},{"id":"275897","messageId":"vpqziw9oefy.fsf@anie.imag.fr","threadId":"41175","inReplyTo":"alpine.DEB.2.20.1601131302340.2964@virtualbox","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-01-13T12:24:01Z","receivedAt":"2016-01-13T12:24:01Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Matthieu,\n>\n> On Wed, 13 Jan 2016, Matthieu Moy wrote:\n>\n>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n>>\n>> What happens if one has branch.*.rebase=interactive, and wants to make\n>> an exception? Does\n>> \n>>   git pull --rebase=true\n>> \n>> cancel the 'interactive' part?\n>\n> It is the same situation as before (just substitute a\n> branch.*.rebase=preserve setting): yes, the config is parsed first, then\n> the command line, so the command line wins.\n>\n>> I guess it is, but if so I think it should be tested and documented.\n>\n> Is this really necessary, given that the behavior has not changed from\n> before?\n\nWell, before your patch, branch.*.rebase=interactive was not possible.\nIt is not immediately clear to me that --rebase=true can mean \"do the\npull with rebasing, but without going interactive\", as \"do pull with\nrebase\" and \"rebase interactively\" could be two independant things.\nReading the current doc does not help much: \"When true, rebase the\ncurrent branch on top of the upstream branch after fetching\" => it does\nnot say that \"true\" also specifies which kind of rebase is performed.\n\nActually, I was about to suggest having --rebase=non-interactive when I\nrealized it was already there with the syntax --rebase=true.\n\nI can live without it, but I think a documentation improvement would\nmake things clearer.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"275903","messageId":"alpine.DEB.2.20.1601131422260.2964@virtualbox","threadId":"41175","inReplyTo":"vpqziw9oefy.fsf@anie.imag.fr","subject":"Re: [PATCH 2/3] Teach 'git remote' that the config var branch.*.rebase can be 'interactive'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T13:26:26Z","receivedAt":"2016-01-13T13:26:26Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Matthieu,\n\nOn Wed, 13 Jan 2016, Matthieu Moy wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Wed, 13 Jan 2016, Matthieu Moy wrote:\n> >\n> >> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> >>\n> >> What happens if one has branch.*.rebase=interactive, and wants to\n> >> make an exception? Does\n> >> \n> >>   git pull --rebase=true\n> >> \n> >> cancel the 'interactive' part?\n> >\n> > It is the same situation as before (just substitute a\n> > branch.*.rebase=preserve setting): yes, the config is parsed first,\n> > then the command line, so the command line wins.\n> >\n> >> I guess it is, but if so I think it should be tested and documented.\n> >\n> > Is this really necessary, given that the behavior has not changed from\n> > before?\n> \n> Well, before your patch, branch.*.rebase=interactive was not possible.\n\nBut branch.*.rebase=preserve was. And it is still different from\nbranch.*.rebase=true. And as per v2.7.0, those config settings can be\noverridden via the command line.\n\nSeeing as I did not change that behavior, I would find it a bit odd to\ndocument that the command line can override the config setting.\n\n> It is not immediately clear to me that --rebase=true can mean \"do the\n> pull with rebasing, but without going interactive\", as \"do pull with\n> rebase\" and \"rebase interactively\" could be two independant things.\n> Reading the current doc does not help much: \"When true, rebase the\n> current branch on top of the upstream branch after fetching\" => it does\n> not say that \"true\" also specifies which kind of rebase is performed.\n\nAgain, I did not change that behavior, and the same confusion could arise\nwith the \"preserve\" setting.\n\nBut I do not really see the confusion, as `git rebase` (without -p and\nwithout -i) means: \"perform a rebase\", and everybody assumes that it is a\nnon-interactive, non-merge-preserving rebase. Hence I would assume that\nusers know that a rebase without any further adjective refers to the\nplain, non-interactive, non-merge-preserving one.\n\nCiao,\nDscho\n"},{"id":"275941","messageId":"xmqqd1t5pej1.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"2ebf99214ba600b63a39c58bcb9abb7941a7619d.1452668201.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-13T17:36:50Z","receivedAt":"2016-01-13T17:36:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> The way builtin pull works, this change also supports the value\n> 'interactive' for the 'branch.<name>.rebase' config variable, which\n> is a neat thing because users can now configure given branches for\n> interactively-rebasing pulls without having to type out the complete\n> `--rebase=interactive` option every time they pull.\n\nSurely this is a better description about the \"config also works and\nit is a good thing\" part.  What I was alluding to was actually this\nyou wrote in 0/3:\n\n    A couple of years ago, I found the need to collaborate on topic\n    branches that were rebased all the time, and I really needed to\n    see what I was rebasing when pulling, so I introduced an\n    interactively-rebasing pull.\n\nthat justifies why allowing 'pull' to invoke interactive rebase is a\ngood thing, which should go before all of the above five lines.\n\nI see you have v3 already (and I read Paul's \"you missed these\"),\nwhich I haven't read yet, but I expect the actual changes are good\nand no longer need rerolling, so I may just insert these four lines\nat the beginning of the log message while queuing, or something.\n\nThanks, both.\n"},{"id":"275959","messageId":"alpine.DEB.2.20.1601131949060.2964@virtualbox","threadId":"41175","inReplyTo":"xmqqd1t5pej1.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-01-13T18:50:00Z","receivedAt":"2016-01-13T18:50:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 13 Jan 2016, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n>     A couple of years ago, I found the need to collaborate on topic\n>     branches that were rebased all the time, and I really needed to see\n>     what I was rebasing when pulling, so I introduced an\n>     interactively-rebasing pull.\n> \n> [...] I may just insert these four lines at the beginning of the log\n> message while queuing, or something.\n\nOh, that's what you meant! Sorry for misunderstanding, and thanks for not\nrequiring a reroll.\n\nCiao,\nDscho\n"},{"id":"275976","messageId":"xmqqio2xmc2k.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"alpine.DEB.2.20.1601131949060.2964@virtualbox","subject":"Re: [PATCH v2 1/3] pull: allow interactive rebase with --rebase=interactive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-13T20:58:11Z","receivedAt":"2016-01-13T20:58:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio,\n>\n> On Wed, 13 Jan 2016, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n>> \n>>     A couple of years ago, I found the need to collaborate on topic\n>>     branches that were rebased all the time, and I really needed to see\n>>     what I was rebasing when pulling, so I introduced an\n>>     interactively-rebasing pull.\n>> \n>> [...] I may just insert these four lines at the beginning of the log\n>> message while queuing, or something.\n>\n> Oh, that's what you meant! Sorry for misunderstanding, and thanks for not\n> requiring a reroll.\n\nHeh, that is too early, as I haven't even read v3 yet.  There we may\nfind other reasons that we would want to improve it before queuing.\n"},{"id":"275978","messageId":"xmqqa8o9mb0o.fsf@gitster.mtv.corp.google.com","threadId":"41175","inReplyTo":"cover.1452687410.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v3 0/3] Support `git pull --rebase=interactive`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-01-13T21:20:55Z","receivedAt":"2016-01-13T21:20:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, queued (with the promised amend to the proposed log message\nof 1/3).\n"}]}