Merge branch 'js/pull-rebase-i'
authorJunio C Hamano <gitster@pobox.com>
Tue, 26 Jan 2016 23:40:28 +0000 (15:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jan 2016 23:40:28 +0000 (15:40 -0800)
"git pull --rebase" has been extended to allow invoking
"rebase -i".

* js/pull-rebase-i:
completion: add missing branch.*.rebase values
remote: handle the config setting branch.*.rebase=interactive
pull: allow interactive rebase with --rebase=interactive

1  2 
Documentation/config.txt
builtin/pull.c
contrib/completion/git-completion.bash
diff --combined Documentation/config.txt
index 07f7a3b771266d488f986cd803e3fd7809533e21,d04a669f002e908d448c361570e1fbad1778dc53..0f710ca3c2fcdfa552c15d346af6995b599b0af4
@@@ -870,6 -870,8 +870,8 @@@ When preserve, also pass `--preserve-me
  so that locally committed merge commits will not be flattened
  by running 'git pull'.
  +
+ When the value is `interactive`, the rebase is run in interactive mode.
+ +
  *NOTE*: this is a possibly dangerous operation; do *not* use
  it unless you understand the implications (see linkgit:git-rebase[1]
  for details).
@@@ -1450,14 -1452,6 +1452,14 @@@ grep.extendedRegexp:
        option is ignored when the 'grep.patternType' option is set to a value
        other than 'default'.
  
 +grep.threads::
 +      Number of grep worker threads to use.
 +      See `grep.threads` in linkgit:git-grep[1] for more information.
 +
 +grep.fallbackToNoIndex::
 +      If set to true, fall back to git grep --no-index if git grep
 +      is executed outside of a git repository.  Defaults to false.
 +
  gpg.program::
        Use this custom program instead of "gpg" found on $PATH when
        making or verifying a PGP signature. The program must support the
@@@ -2157,6 -2151,8 +2159,8 @@@ When preserve, also pass `--preserve-me
  so that locally committed merge commits will not be flattened
  by running 'git pull'.
  +
+ When the value is `interactive`, the rebase is run in interactive mode.
+ +
  *NOTE*: this is a possibly dangerous operation; do *not* use
  it unless you understand the implications (see linkgit:git-rebase[1]
  for details).
diff --combined builtin/pull.c
index 9e3c73809f83af636150cc3edd8628c339ba40c1,c7b39b428f7746f0c1925b2d417de91818a8b303..c713fe065beb2ac9d1c8058bf101094e99199766
@@@ -22,7 -22,8 +22,8 @@@ enum rebase_type 
        REBASE_INVALID = -1,
        REBASE_FALSE = 0,
        REBASE_TRUE,
-       REBASE_PRESERVE
+       REBASE_PRESERVE,
+       REBASE_INTERACTIVE
  };
  
  /**
@@@ -42,6 -43,8 +43,8 @@@ static enum rebase_type parse_config_re
                return REBASE_TRUE;
        else if (!strcmp(value, "preserve"))
                return REBASE_PRESERVE;
+       else if (!strcmp(value, "interactive"))
+               return REBASE_INTERACTIVE;
  
        if (fatal)
                die(_("Invalid value for %s: %s"), key, value);
@@@ -95,7 -98,6 +98,7 @@@ static int opt_force
  static char *opt_tags;
  static char *opt_prune;
  static char *opt_recurse_submodules;
 +static char *max_children;
  static int opt_dry_run;
  static char *opt_keep;
  static char *opt_depth;
@@@ -113,7 -115,7 +116,7 @@@ static struct option pull_options[] = 
        /* Options passed to git-merge or git-rebase */
        OPT_GROUP(N_("Options related to merging")),
        { OPTION_CALLBACK, 'r', "rebase", &opt_rebase,
-         "false|true|preserve",
+         "false|true|preserve|interactive",
          N_("incorporate changes by rebasing rather than merging"),
          PARSE_OPT_OPTARG, parse_opt_rebase },
        OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
                N_("on-demand"),
                N_("control recursive fetching of submodules"),
                PARSE_OPT_OPTARG),
 +      OPT_PASSTHRU('j', "jobs", &max_children, N_("n"),
 +              N_("number of submodules pulled in parallel"),
 +              PARSE_OPT_OPTARG),
        OPT_BOOL(0, "dry-run", &opt_dry_run,
                N_("dry run")),
        OPT_PASSTHRU('k', "keep", &opt_keep, NULL,
@@@ -529,8 -528,6 +532,8 @@@ static int run_fetch(const char *repo, 
                argv_array_push(&args, opt_prune);
        if (opt_recurse_submodules)
                argv_array_push(&args, opt_recurse_submodules);
 +      if (max_children)
 +              argv_array_push(&args, max_children);
        if (opt_dry_run)
                argv_array_push(&args, "--dry-run");
        if (opt_keep)
@@@ -778,6 -775,8 +781,8 @@@ static int run_rebase(const unsigned ch
        /* Options passed to git-rebase */
        if (opt_rebase == REBASE_PRESERVE)
                argv_array_push(&args, "--preserve-merges");
+       else if (opt_rebase == REBASE_INTERACTIVE)
+               argv_array_push(&args, "--interactive");
        if (opt_diffstat)
                argv_array_push(&args, opt_diffstat);
        argv_array_pushv(&args, opt_strategies.argv);
index ab4da7f979177a3304eb08d85869c1a141e81064,880a69a271c36d5ee9ba12034df1cae461ee2bb8..51f5223e2a373a03963ac20e7ebfc65405fb8eef
@@@ -1312,7 -1312,6 +1312,7 @@@ _git_grep (
                        --full-name --line-number
                        --extended-regexp --basic-regexp --fixed-strings
                        --perl-regexp
 +                      --threads
                        --files-with-matches --name-only
                        --files-without-match
                        --max-depth
@@@ -1809,7 -1808,7 +1809,7 @@@ _git_config (
                return
                ;;
        branch.*.rebase)
-               __gitcomp "false true"
+               __gitcomp "false true preserve interactive"
                return
                ;;
        remote.pushdefault)